G.SetGlobalBool
From GMod Wiki
Function | |
Syntax |
SetGlobalBool( Var index, Boolean value ) Where is this used? |
Description: | |
Similiar to the function Entity:SetNetworkedBool - Sets a networked Boolean , but outside of the entity. | |
Returns: | nil |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.SetGlobalBool]G.SetGlobalBool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Sets 2 global booleans which you can later get with GetGlobalBool. |
---|---|
Used on | |
Code | SetGlobalBool( 666, true ) SetGlobalBool( "Is this game awesome?", false ) |
Output | N/A |
Additional Notes
- Running a networked function will cause it to synchronize the networked data with the clients.
- Index can be a String or Integer - however, when dealing with global networked variables, it's suggested that you use a string with part of the name of your script in it - like "mygamemode_tickrate", for example.
- Running this function clientside will only set it clientside - not serverside.
- Only set networked variables when necessary - sending networked variables constantly is expensive.