G.SetGlobalFloat
From GMod Wiki
| Function | |
| Syntax |
SetGlobalFloat( Var index, Float value ) Where is this used? |
| Description: | |
| Similiar to the function Entity:SetNetworkedFloat - Sets a networked Float , but outside of the entity. | |
| Returns: | nil |
| Part of Library: | Global Functions |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.SetGlobalFloat]G.SetGlobalFloat [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Sets 2 global floats which you can later get with GetGlobalFloat. |
|---|---|
| Used on | |
| Code | SetGlobalFloat( 100, 50 + 25 + 12.5 + 6.25 + 3.125 + 1.0675 ) SetGlobalFloat( "Pi", math.pi ) |
| 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 .
- Running this function clientside will only set it clientside - not serverside.
- Only set networked variables when necessary - sending networked variables constantly is expensive.