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

(Solved) I'm trying to increase the player's walkspeed and jumppower. What am I doing wrong?

Here's the code block

local Players = game:GetService("Players")
local plr = game.Players.LocalPlayer

wait(1)
Players.PlayerAdded:Connect(function(player)
	plr.Character.Humanoid.WalkSpeed = 32
	plr.Character.Humanoid.JumpPower = 60
end)

2 comments

0

Could be due to the fact that you're using 'game.Players.LocalPlayer' in what should be a normal script, not a local script.

0

Oh

2 answers

✓ Accepted answer

This will fix it.

game.Players.PlayerAdded:Connect(function(player)
	repeat wait() until player and player.Character
		delay(1, function() 
		local h = player.Character.Humanoid
		h.WalkSpeed = 32;
		h.JumpPower = 60;	
	end)
end)

2 comments

0

Worked perfectly! Thanks!

0

You're welcome.

And it uses a Server Script, not a LocalScript.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
        player.CharacterAdded:Connect(function(character)
		character.Humanoid.WalkSpeed = 32
	        character.Humanoid.JumpPower = 60
	end)
end)

2 comments

0

I inserted the server script in both StarterCharacterScripts and Workspace and both did not work.

0

ServerServiceScript

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