local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")
while true do
wait(.5)
humanoid:ChangeState('Jumping')
humanoid:SetStateEnabled('Jumping', false)
end
Assuming you are attempting to make a system similar to that of Tower of Hell, your issue lies in the delay.
You are trying to wait(0.5), but in that time span the user has time to manually jump - to fix this change your code from wait(n) to just simply wait().
As has become common knowledge at this point, wait in and of itself is unreliable so I recommend adding this code at the top of your script in order to overwrite the default wait function with a more reliable alternative.
local RunService = game:GetService("RunService")
local wait = function(waitTime)
if not waitTime then waitTime = 0 end
local startTime = tick()
repeat RunService.Heartbeat:Wait() until startTime+waitTime < tick()
return tick()-startTime, elapsedTime()
end
I guess you better use @Imp_erator’s solution but heres very simple solution
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")
while true do
humanoid.JumpPower = 0
wait(.5)
humanoid.JumpPower = 50
humanoid.Jump = true
wait(.3)
end