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

How to make an event run every 2-5 minutes?

I'm trying to make an event happen every 2-5 minutes. How would I do that? In my game,a random event will run every 2-5 minutes, but I don't know how to even begin.

6 comments

0

Hey! What Event are you talking about? a event that happens world wide or a event you activate in studio?

0

Sorry I didn't really explain the event that happens world wide, The event is automatically on

0

Is it a RemoteEvent?

0

If you're talking about an event as in like tacos falling from the sky then could you please list every single event you're talking about.

0

Well it's more of just a random thing that happens. Like for example, a knife might pop up somewhere,or a door might open. That's what I mean by event.

0

I've created the map,the atmosphere and all. Every couple of weeks I would update it to add more "events" that will happen every 2-5 minutes.

1 answer

I'm not entirely sure what you mean, but this might work:

while condition do
	wait(math.random(120,300))
	event
end

Replace "condition" with whatever condition it is, and replace "event" with whatever event you're trying to fire. If you don't want it to run all the time, you could put the while loop in a function that fires at a certain point (for example when the condition in the while loop is met).

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