State<T>
A single value shared across your scripts that tells you when it changes, which you create with state.create.
Events
changedEvent<(T, T)>
A single value shared across your scripts that tells you when it changes, which you create with state.create.
Gives a copy of the current value, so changing that copy does nothing until you set it.
print(score:get())Use it forreading the current round number or game phase from any of your scripts.
Changes the value, and fires changed when the new value is different.
score:set(10)Use it forswitching the game phase from lobby to playing, which every listening script can react to.
valueThe new value.Hands your function the current value, and saves whatever it gives back.
score:update(function(value) return value + 1 end)Use it foradding a new name to the list of round winners without losing the names already there.
updateGets the value and returns the new one.