script.Parent.Touched:Connect(function(Hit)
wait(0.5)
Hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end)
script.Parent.Touched:Connect(function(Hit)
wait(0.5)
Hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end)
the parent of the touched function, needs to see if it really is a player.
Try this
script.Parent.Touched:Connect(function(player)
local humanoid = player.Parent:FindFirstChild("Humanoid")
if humanoid~= nil then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)
You Should use:
Hit.Parent.Humanoid.Jump = true
Do not forgot to check if the humanoid Exists, or else the script will throw lots of errors!
script.Parent.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChildOfClass('Humanoid') ~= nil then --Checks if the Humanoid Exists
Hit.Parent.Humanoid.Jump = true --Makes the Character Jump
end
end)
This is optional, you can Add a Debounce to the script:
local Debounce = false
script.Parent.Touched:Connect(function(Hit)
if not Debounce and Hit.Parent:FindFirstChildOfClass('Humanoid') ~= nil then --Checks if the Humanoid Exists
Debounce = true
Hit.Parent.Humanoid.Jump = true --Makes the Character Jump
wait(1) --Cooldown
Debounce = false
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
But thats what i told him to do ;(
sorry i didn't notice it, i started writing it.. probably at same time as you :P
Didn't work. Checing the humanoid has nothing to do with it.