I have asked a question about how to fix my HopperBin which would change speed on selected. I was given 2 answers of which didn't work, then no one started answering so I deleted after 2-3 days of leaving it there and changing title. So now i'm just wondering how can I find the player who is using the tools, body? Example- finding "alphawovless" in Workspace. Here's the "fixed" script I was given.
SP = script.Parent humanoid = script.Parent.Players.LocalPlayer.Character.Humanoid SP.Selected:connect(function() if humanoid.WalkSpeed == 16 then humanoid.WalkSpeed = 32 end end)
Please help? Make sure the script works before you tell me it and why that works instead before posting it...
SP = script.Parent humanoid = game.Players.LocalPlayer.Character.Humanoid --This only works in a LOCAL SCRIPT SP.Selected:connect(function() if humanoid.WalkSpeed == 16 then humanoid.WalkSpeed = 32 end end)
Make sure the script is a local script. More on LocalPlayer.
You might want to change this script so if they deselect it they don't stay "running".
SP = script.Parent humanoid = game.Players.LocalPlayer.Character.Humanoid SP.Selected:connect(function() if humanoid.WalkSpeed == 16 then humanoid.WalkSpeed = 32 end end) SP.Deselected:connect(function() if humanoid.WalkSpeed == 32 then humanoid.WalkSpeed = 16 end end)