Universal Script πŸ“Œ
698 Views
294 Executions

Stand on players head with out collision

Universal Script πŸ“Œ
ScriptDAILY
ScriptDAILYPublished 5
10 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
rocketscript10 months ago

Holy ChatGPT is getting better at coding dang

1
ScriptDAILY's profile picture
ScriptDAILYUploader10 months ago

@rocketscript No it was Gemini

2

More universal scripts

See all
Script hub
164
989
Bumped 1 hour ago

Script hub

Lunyx Hub

Script hub
120.8k
221.2k
Bumped 1 hour ago
Key System
Script hub
10.6k
201.0k
Bumped 2 hours ago

Script hub

KeylessVerified script badgeIRIDIUM HUB | #1

Script hub
33.3k
299.8k
Bumped 5 hours ago
Script hub
23.7k
5.3k
Bumped 5 hours ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
329
1.2k
Bumped 5 hours ago