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

How to make ALL players speed up?

I'm creating an obby that you have to go fast. I got a solution, but i had my friend try it and it won't work for him. And i can understand why, because this is what i used.

game.Workspace.Roblozinko.Humanoid.WalkSpeed = 75
repeat
	game.Workspace.Roblozinko.Humanoid.WalkSpeed = 75
	wait (.5)
until 6 == 5

It's because his and my username is different, so it only works for me. and i tried one from another question,

wait (5)
repeat
	game.Workspace.Player1.Humanoid.WalkSpeed = 75
	wait (.5)
until 6 == 5

and that didn't work. I got the output, "Player1 is not a valid member of workspace." I also tried it in a localScript and Script. Please help! thanks. :3

2 comments

0

it dose not work for your friend because your only saying that "Roblozinko" will get the walk speed of 75

0

That's what i was saying

3 answers

✓ Accepted answer

Simple and straightforward: Whenever a players' character is added, set their Humanoid's WalkSpeed to 75. This can be accomplished using the CharacterAdded event of Player instances.


Insert a Script into ServerScriptService:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char) -- This will fire every time their player's chararcter gets added
		char:WaitForChild("Humanoid").WalkSpeed = 75
	end)
end)

Hope I helped!

2 comments

0

Where's my credit at?

0

Wow. Nice! :D

Maybe try this method.

local Players = game:GetService("Players")
for _,Player in pairs(Players:GetPlayers()) do
	local Char = Player.Character or Player.CharacterAdded:Wait()
	if Char then
		Char:WaitForChild("Humanoid").WalkSpeed = 75
	end
end)

1 comment

0

great explanation

x = 50 --speed boost

for i,v in pairs(game.Players:GetPlayers()) do v.Character.Humanoid.Walkspeed = x end

3 comments

0

use script blocks dude

0

He is just trying to help, no need to downvote.

0

great explanation

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