--THIS LOOPS THE JUMP HOW DO I MAKE IT JUMP ONCE EVERY 5 SECONDS?
AFK_ON.MouseButton1Down:connect(function() AFK_OFF.Visible = false AFK_ON.Visible = true while true do wait(5) local plr = game.Players.LocalPlayer local chr = plr.Character chr:WaitForChild("Humanoid"):connect(function() chr.Humanoid.Jump = true end) end end)
--I TRIED THIS ALSO AND IT DOESN'T WORK
AFK_ON.MouseButton1Down:connect(function() AFK_OFF.Visible = false AFK_ON.Visible = true while true do wait(5) game.Players.LocalPlayer.Humanoid.Jump = true end end)
So, here is the code, hopefully fixed:
["AFK_ON"].MouseButton1Down:connect(function() ["AFK_ON"].Visible = false ["AFK_ON"].Visible = true while wait(5) do --set that number to the amount of seconds to wait game.Players.LocalPlayer.Character.Humanoid.Jump = true end end)
Your problem was that you were addressing the player, not the character.
game.Players.LocalPlayer.Humanoid.Jump = true
To address the character, you need to do this:
game.Players.LocalPlayer.Character.Humanoid.Jump = true
Notice the "Character" after the "LocalPlayer"
If this helped, please accept the answer. Thanks!