Hi, I have a script that sets the walkspeed of the player when they enter the game depending on the team they are on however it doesn't seem to function and I can't identify the problem.
Here is the script:
plr = script.Parent
function onSpawn(Char)
if game.Players:FindFirstChild(Char.Name)~=nil then
if plr.TeamColor==BrickColor.new("Really black") then
Char.Humanoid.WalkSpeed = 0
end
end
game.Workspace.ChildAdded:connect(onSpawn)

1 comment
What is the purpose of setting WalkSpeed to 0 exactly? I ask because this is exploitable, a client script can set walkspeed to something else and the player will still be able to walk around, with their movement replicated to the server.