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

While jump, speed increases?

How do I do a script where your speed only increases when you jump? Im new to scripting, so I have no idea how to do it.

1 answer

Not A Request Site

But, since this script is fairly simple, you would want to check if the humanoid's property, jumping, is active. If it is then increase their speed.

ServerScript in ServerScriptService

This code will run whenever a player joins.

game.Players.PlayerAdded:Connect(function(player)
	--// Code here will run whenever the player joins.
end)

This code will run whenever a new character is respawned.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		--// Code here will run everytime a new character is respawned.
	end)
end)

So, to do this is fairly simple.

You would get the humanoid of the character and check if they jumped.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local INCREMENTAL = 5
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.Jumping:Connect(function()
			humanoid.WalkSpeed = humanoid.WalkSpeed + INCREMENTAL
		end)
	end)
end)

Hope this helped! But, remember this is NOT A REQUEST SITE.

We help with previous attempted scripts and help you on improving them. Next time, try them on your own and do some research and post your attempted code so we can help you on learning and improving your mistakes.

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