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 6 years ago
Edited 6 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 — 6y
0
boi free models are dangerous and can infect your game with like millions of children HappyTimIsHim 652 — 6y
0
Use a blank place and check the script. Duh. DinozCreates 1070 — 6y
0
using a free model is no fun HappyTimIsHim 652 — 6y
View all comments (2 more)
0
I didnt say you had to use it. Learn from it. DinozCreates 1070 — 6y
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 — 6y

3 answers

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

That's simple, You could've figured it out yourself, I will give you the script anyways

1game.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 — 6y
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 — 6y
0
Wait The local player is causing an error. Anyway that I could fix this Noonekirby 162 — 6y
0
You would need to use a local script, Sorry I forgot to mention that. Avia_Robby 42 — 6y
0
kk thanks! Noonekirby 162 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

In a script do

01Cooldown = --what you want your cooldown to be
02Lasting = --how long you want it to last
03Speed = --how fast you want the player to go
04db = false --debounce
05part = script.Parent
06part.Touched:Connect(function(hit)
07    if db == false then
08        db = true
09        plr = hit.Parent
10        ctr = plr.Character or plr.CharacterAdded:Wait()
11        hum = ctr:WaitForChild("Humanoid")
12        hum.WalkSpeed = Speed
13        Wait(Lasting)
14        hum.WalkSpeed = 16 --or your game default speed
15        Wait(Cooldown)
16        db = false
17    end
18end

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

01Speed = --how fast you want the player to go
02run = false --debounce
03part = script.Parent
04part.Touched:Connect(function(hit)
05    if run == false then
06        run = true
07        plr = hit.Parent
08        ctr = plr.Character or plr.CharacterAdded:Wait()
09        hum = ctr:WaitForChild("Humanoid")
10        hum.WalkSpeed = Speed
11        else
12        run = false
13        plr = hit.Parent
14        ctr = plr.Character or plr.CharacterAdded:Wait()
15        hum = ctr:WaitForChild("Humanoid")
16        hum.WalkSpeed = 16 --or your own normal speed
17    end
18end
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Make a brick then insert a script into it.

1script.Parent.Touch:Connect(function(hit)
2if hit.Parent:FindFirstChild("Humanoid") then
3hit.Parent:FindFirstChild("Humanoid").Walkspeed = 25
4end)

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.

1script.Parent.Touched:Connect(function(hit)
2if hit.Parent:FindFirstChild("Humanoid") then
3hit.Parent:FindFirstChild("Humanoid").WalkSpeed = 16
4end
5end)

Answer this question