#Scripts Executing Before Variable Loads

1 messages · Page 1 of 1 (latest)

void bane
#

I have scripts that run constantly while the game is played, and they rely on global variables. However, it appears that occasionally these scripts load before the variables are established in later-loaded scripts. As such, I have had to add "_G.var = _G.var or 0" to the top of every script using these global variables.

Is there an easier way to tell the script "do not execute until this variable is not nil?"

oak joltBOT
#

studio** You are now Level 1! **studio

ruby plaza
#

declare it inside of the running function

left tendon
narrow kernel
#
repeat task.wait() until varibleName

example of what angelo is suggesting

oak joltBOT
#

studio** You are now Level 16! **studio