Garry's Mod Wiki

SetGlobalInt

  SetGlobalInt( string index, number value )

Description

Sets an integer that is shared between the server and all clients.

There's a 4095 slots Network limit. If you need more, consider using the net library or SetGlobal2Int. You should also consider the fact that you have way too many variables. You can learn more about this limit here: Networking_Usage
Running this function clientside will only set it clientside for the client it is called on!
This function will not round decimal values as it actually networks a 64 bit float internally.

Issue Tracker: 3374

Arguments

1 string index
The unique index to identify the global value with.
2 number value
The value to set the global value to

Example

Sets the current round number.

SetGlobalInt("RoundNumber", 4)