Universal Script 📌
672 Views
264 Executions

Stand on players head with out collision

Universal Script 📌
ScriptDAILY
ScriptDAILYPublished 5
9 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Allows you to float on players head without collision.

View Raw
local RunService = game:GetService("RunService")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")

-- Settings
local RAY_LENGTH = 3.5 -- How far down to look for a player
local BOUNCE_FORCE = 5  -- Small upward force to stay on top

RunService.Heartbeat:Connect(function()
	-- Only run if we are actually in the air/falling
	if Humanoid:GetState() == Enum.HumanoidStateType.Freefall or Humanoid:GetState() == Enum.HumanoidStateType.Jumping then
		
		-- Setup Raycast
		local raycastParams = RaycastParams.new()
		raycastParams.FilterDescendantsInstances = {Character}
		raycastParams.FilterType = Enum.RaycastFilterType.Exclude

		-- Cast downwards
		local raycastResult = workspace:Raycast(Root.Position, Vector3.new(0, -RAY_LENGTH, 0), raycastParams)

		if raycastResult and raycastResult.Instance then
			local hitModel = raycastResult.Instance:FindFirstAncestorOfClass("Model")
			
			-- Check if the hit object is a player
			if hitModel and hitModel:FindFirstChild("Humanoid") then
				-- Stop falling through them by resetting Y velocity
				Root.AssemblyLinearVelocity = Vector3.new(Root.AssemblyLinearVelocity.X, BOUNCE_FORCE, Root.AssemblyLinearVelocity.Z)
				
				-- Optional: Change state to Landed to allow another jump immediately
				Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
			end
		end
	end
end)


Comments

2
Log in to join the conversation. Login
rocketscript's profile picture
rocketscript9 months ago

Holy ChatGPT is getting better at coding dang

1
ScriptDAILY's profile picture
ScriptDAILYUploader9 months ago

@rocketscript No it was Gemini

2

More universal scripts

See all
Script hub
46.4k
11.5k
Bumped 2 hours ago
Key System
Paid
Script hub
2.5M
798.8k
Bumped 3 hours ago
Key System

Script hub

#9 today

Verified script badgeLumin Hub | #1 | Insta Steal