Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make players move at different speeds?{Solved}

Asked by 5 years ago
Edited 5 years ago

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.

0
I dont feel like you've sufficiently researched this before asking your question. You could find 100 free models that change a players speed by touch. DinozCreates 1070 — 5y
0
boi free models are dangerous and can infect your game with like millions of children HappyTimIsHim 652 — 5y
0
Use a blank place and check the script. Duh. DinozCreates 1070 — 5y
0
using a free model is no fun HappyTimIsHim 652 — 5y
View all comments (2 more)
0
I didnt say you had to use it. Learn from it. DinozCreates 1070 — 5y
0
You are right, Dinoz. I just checked and and saw a bunch of models that I'm now using mixed with Avia's answer! Happy, I used your words of warning and made that the free models won't destroy my game. Thank you both for your comments! Noonekirby 162 — 5y

3 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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!

0
So wholesome, I don't think I've ever had someone wish me luck! I would upvote your answer, but I don't have enough reputation. Noonekirby 162 — 5y
0
I fail to see how that would help, I mean if it's a local script, Sure! Else you have a problem. namespace25 594 — 5y
0
Wait The local player is causing an error. Anyway that I could fix this Noonekirby 162 — 5y
0
You would need to use a local script, Sorry I forgot to mention that. Avia_Robby 42 — 5y
0
kk thanks! Noonekirby 162 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)

Answer this question