Entity.SetNetworkedVector
From GMod Wiki
| Function | |
| Syntax | Entity:SetNetworkedVector( Var index, Vector value ) |
| Description: | |
| Sets a networked Vector in this entity with the given index to the given value. | |
| Returns: | nil |
| In Object: | Entity |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.SetNetworkedVector]Entity.SetNetworkedVector [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Stores the position of "MyEntity" to a networked vector "EntityPos" |
|---|---|
| Used on | Server |
| Code | MyEntity = ents.Create("prop_physics") position = MyEntity:GetPos() MyEntity:SetNetworkedVector("EntityPos",position) |
| Output | none |
Additional Notes
- Can be written SetNWVector().
- 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. You should set networked variables to their defaults in the initilization function of a scripted entity or SWEP.
- Only set networked variables when necessary - sending networked variables constantly is expensive.