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

How do I track the time a player has walked, and then teleport them somewhere after 2 minutes?

Asked by 4 years ago

I am making a game themed around this dimension that you might randomly step into a new time period. To do this, I wanted to track how long a player walks around, and after so long they will "step" (Teleport) into a new dimension! If it's easy enough, how would I make the time random, say some time between 1 minute and 3.5 minutes!

More clarification: A script that counts how many seconds a player has been walking (discluding standing still, or jumping). After 1-3.5 minutes, it will teleport them to a new area.

0
You can just put a invisible teleport part to where you want them to walk to 6zk8 95 — 4y
0
I dont want it to be a location in which they walk, I want it to be the time they have walked Rhynokeros 0 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

math.random

After you teleport them, wait a random amount of time. Consider that wait is measured in seconds, and therefore you'll need to wait a random interval between 1*60 and 3.5*60

0
I guess that could work, but is there any way to make a timer that pauses (not stops) while the user is not walking? Rhynokeros 0 — 4y
0
tick User#6546 35 — 4y
Ad
Log in to vote
0
Answered by
Zero_Tsou 175
4 years ago
Edited 4 years ago

Do:

if humanoid.MoveDirection.Magnitude > 0 then -- humanoid is the child of the player's character
 ---------- ur script 
end

Answer this question