I am attempting to have one script with a boolean variable determine if another script should run.
I seem to be having trouble getting the variable to transfer over though.
This is a basic summary of what I am trying to do. (Rather than throwing my entire block of code at you)
Script 1:
1 | start = true |
Script 2:
1 | while true do |
2 |
3 | while start do -- "start" is used here |
4 | -- Blah blah blah, code here. (Nothing that affects "start") |
5 | wait() |
6 | end |
Is this how I would use non-local variables inside other scripts?
All the scripts that use such things are running when I run my environment (I have a "while true" keeping them running in the background).
However, script 2 never goes through that second while loop.
Anyone have ideas?
Thanks
Say you have _G.Var = true
in the server-script 'apple' then you have another server-script called 'Bananas' you can access _G.Var
from Bananas since it is Global
In Apples
1 | _G.Var = true |
In Bananas
1 | print (_G.Var) |
Please upvote my answer if this helped.