I'm currently making a game that's like a lobby/map game, but each round lasts irregular intervals.
The concept of the game is to race each other completing obstacle courses. When someone takes first place, other players have 300 seconds left to finish.
The easy part is telling what the events need to do. The hard part is scheduling the events so they run one after another.
Here's what I have in the script that schedules the events.
rounds = game.Workspace.RoundEventHandler
pmap = game.Workspace.PreviousMap
cmap = game.Workspace.CurrentMap
maps = game.ServerStorage.Legs
randomtwist = game.Workspace.RandomTwist
script.Round.Event:connect(function()
wait (10)
rounds.Intermission:Fire()-- starts intermission
wait (34)
rounds.Starting:Fire()-- starts the beginning of the race
game.Workspace.EventHandler.Randomtwist:Fire()-- fires an event that chooses a random number
wait (34)
if game.Workspace.RandomTwist.Value == 2 then-- if the random number is two, then
rounds.Twist:Fire()
end
end)
I find this REALLY inefficient, because i need to put waits() everywhere. Also, the script used to be a while true do loop, but I changed it to an event of its own, because while true do loops start over again after the last line runs.
