There's actually nothing wrong with the orientation of the functions. If nothing calls the functions, it just iterates over the functions and loads them, what's wrong is this:
function preGame()
startGame
end
the "startGame" does not have a function bracket thingie which prevents endGame() from being defined. Although I'd imagine the script would 100% break before any function could run in it.
Anyways, I recommend a set up like this:
function startGame()
f script.Running.Value = -1 then
endGame()
end
end
function preGame()
startGame()
end
function endGame()
preGame()
end
startGame()
Run any type of function AFTER all the above functions (shown in the example above), so the functions get defined and you won't get the error. You can never call a function that hasn't been made since it'd be "nil"
4 comments
Since you are using a round system based game I would suggest organizing your variables, functions etc.. in a module. They are more efficient. Organizing your functions like you did is not a good idea, since you are going to use a ton of functions the script will be so messy and you will suffer when udating your code.
alright thanks, it works now
You could use _G
what is that?