Can you change GlobalState on server-side?

Hello. I have a question: can I change GlobalState variable on server-side somehow? I’ve tried something like this, but the value doesn’t change:

GlobalState.testState= true
GlobalState.testState= false
print(GlobalState.testState) -- still true

Thank you :slight_smile:

Can you try with any other value than false? It might be Lua’s nil/false-are-false is leading to some odd behavior.

1 Like

Fixed it! There was a problem in other part of script. Changing global states works fine! Sorry for the trouble :slight_smile:


an small tip for if you want to call that in other scripts, you could have an look at ** ```
SetConvar(“convar_name”, “This is a convar value that contains spaces!”)

if you want to toggle an true to false you could also use `GlobalState.testState = not GlobalState.testState` 

kind regards