So I'm scripting a button that changes the players walkspeed to 0 when they click it. This is all supposed to happen to only the player that clicked the button. Problem happens is that.. Nothing happens when a person clicks the button. Here's the script that's inside a local script.
local player = game.Players:FindFirstChild()
script.Parent.ClickDetector.MouseClick:Connect(function()
if player then
player.Character.Humanoid.WalkSpeed = 0
else repeat until player
end
end)

1 comment
Thank you! I learned a ton from this :>