I want to learn how to make people move at different speeds like in Flee The Facility, where one player is faster than others. I've tried to search it up, but all of the tutorials I've seen so far lead me to change the default speed of all the players.
is there a way that I can have a part when touched speeds up the player?
Solved: Use Avia's method or Dinoz method in the comments.
That's simple, You could've figured it out yourself, I will give you the script anyways
game.Players.LocalPlayer.Character.Humanoid.Walkspeed = 0 --Changes the speed of a player to 0
MAKE SURE TO USE A LOCAL SCRIPT
If you need more help just tell me in the comments.
If the answer was helpful please upvote it and mark it as correct.
Good luck with your game!
In a script do
Cooldown = --what you want your cooldown to be Lasting = --how long you want it to last Speed = --how fast you want the player to go db = false --debounce part = script.Parent part.Touched:Connect(function(hit) if db == false then db = true plr = hit.Parent ctr = plr.Character or plr.CharacterAdded:Wait() hum = ctr:WaitForChild("Humanoid") hum.WalkSpeed = Speed Wait(Lasting) hum.WalkSpeed = 16 --or your game default speed Wait(Cooldown) db = false end end
hit is what touched the part make sure the script is inside of the part that gives you speed or if you want it so that it turns to normal speed when it touches again do
Speed = --how fast you want the player to go run = false --debounce part = script.Parent part.Touched:Connect(function(hit) if run == false then run = true plr = hit.Parent ctr = plr.Character or plr.CharacterAdded:Wait() hum = ctr:WaitForChild("Humanoid") hum.WalkSpeed = Speed else run = false plr = hit.Parent ctr = plr.Character or plr.CharacterAdded:Wait() hum = ctr:WaitForChild("Humanoid") hum.WalkSpeed = 16 --or your own normal speed end end
Make a brick then insert a script into it.
script.Parent.Touch:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid").Walkspeed = 25 end)
When you step on the brick your speed will change.
Then if you want to change the speed back to normal again. Make a brick then insert a script into it.
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid").WalkSpeed = 16 end end)