Entity.SetNetworkedString

From GMod Wiki

(Redirected from Entity.SetNWString)
Jump to: navigation, search
Function
Syntax Entity:SetNetworkedString( Var index, String value )
Description:
Sets a networked String in this entity with the given index to the given value.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetNetworkedString]Entity.SetNetworkedString [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets networked strings "Name" and "Country" for entity "Box" and prints them to console
Used onNewerServer.png
Code
 
Box = ents.Create("prop_physics")
Box:SetNetworkedString("Name", "Bill Gates")
Box:SetNetworkedString("Country","United States")
Msg(Box:GetNetworkedString("Name")..": "..Box:GetNetworkedString("Country"))
 
OutputBill Gates: United States


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox