How to organize random events for my randomized obby?

Hey guys. I’m currently working on a randomly generated obby, and I am going to add random events to it now. The idea is that every round, a random event/disaster is selected, which makes the obby more random. There is also a secondary event that is more of a smaller random addition to the obby. My issue is that I currently do not know a good way to organize and run functions/events to make this happen. It will have many, many events and secondary events, so this is a must. I know that you can make module functions in module scripts but I still don’t know how I would organize that, because the module script would definetly get very lengthy and annoying to navigate. I have tried finding tutorials on this problem but I couldn’t find anything.

Just so you know, the obstacles (lasers, fading platforms, spinning lasers, ice, etc.) are given their functions with Collection Service (Tags).

Thank you all!

bro i don’t know how to organize 50 events in one module script

1 Like

Hello!

I don’t know if this would work or not, but you have a table of all the events you want to happen. Name them as strings and then pick a random event using the math.random function. Use an if statement to check each one. Example:

if chosenEvent == "LaserBeams" then
--Do stuff
end

This may not be the most efficient or organized, but should work!

Hope this helps! :slight_smile:

1 Like

Alright I’ll try to see if this works, thanks

1 Like

You’re welcome! Let me know if it does or if you need help!