Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

jump script every 5 seconds? (R15)

--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)

3 comments

0

Is this a server script or local script?

0

Try using things like jump = false whenever the character jumps and wait (5) until jump = true again

0

Turn off your caps lock, Jesus.

1 answer

So, I'm assuming this is a local script...

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!

2 comments

0

thank you so much! my script finally works!

0

Please accept the answer. It will give us both reputation, and shows that my answer solved your question.

This discussion is preserved as it was. New answers, comments, and votes are closed.