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)