Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

2 comments

0

You can just put a invisible teleport part to where you want them to walk to

0

I dont want it to be a location in which they walk, I want it to be the time they have walked

2 answers

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

2 comments

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?

0

tick

Do:

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

This discussion is preserved as it was. New answers, comments, and votes are closed.