hi, im kinda struggling on this script like when i use for i,v in pairs on the humanoid.WalkSpeed, the speed wont change to 0, idk why am i do it wrong or should i not using for i,v in pairs? heres the script
for i,v in pairs(game.Players:GetPlayers()) do
local char = v.Character
local hum = char:FindFirstChild("Humanoid")
hum.WalkSpeed = 0
wait(3)
hum.WalkSpeed = 16
end
btw wat i want to achive is, when the match isnt starting then all players in the match cant move or disable movement, but when the match is starting all players can walk normaly, any ideas?

5 comments
sorry dude, still not working tho idk why, but when i run the script there is no printed name,
that is strange, but i think you might just need to add a wait before the script starts or try put it in a while loop if you copied in a server script because services and scripts load first sometimes they run before the objects they are referencing even exist,
Still doesnt workdude idk why, i tried adding wait and CharacterAdded:Wait() but still it doenst work,
yes so I tried it again and it didn't work, but it worked when I added a wait(5) so I think you should try that, I think the reason it worked for me the first time is because I had it in a while loop but for practicality in your game you shouldn't have it in a while loop of course
oh rlly? dang thats got to be something else man it worked for me, is there anythign else that could be the problem? like maybe you have the script in replicated storage or server storage, are there any other scripts that could affect it? could you give a screen shot of the explorer in your studio?