I'm making a game where when the round ends, it resets back to the intermission and then another round begins. I have to make the game repeat, but I can't put everything in a loop because there's some issues with other loops and functions. Is it possible to do this:
[Intermission code] [Map voting code] [Winner code] --Go back to line 1
If someone could help, that would be greatly appreciated!
There is a way called loops. Loops are basically a line of code that repeats the same thing over and over again for a certain amount of time.
For loops for example repeat code for how many times you put it, like this:
for i = 1, 10, 0 do --Code here end)
You can watch PeasFactory's videos of loops, that's how I learned it.
https://www.youtube.com/watch?v=O2Ikk1JSInw
Theres also while true do loops which repeats code forever:
while true do --code here end
I think you are looking for a function? If so try something like this:
local function newRound() --Code to repeat goes here end
then you call the function whenever it is needed by typing
newRound()
so you get
local function newRound() --Code to repeat goes here end newRound() -- Runs it at the start
You may also want to check https://developer.roblox.com/en-us/articles/Function for more on functions, and https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events on how to activate it when needed!
Sorry if I was a bit vague on it, and that I couldn't give a sample code for Remote Functions and Events, but i'm still learning how to use them!
Hope this helped!