Garry's Mod Wiki

Entity:SetNWEntity

Entity:SetNWEntity( string key, Entity value )

Description

Sets a networked entity value on the entity.

The value can then be accessed with Entity:GetNWEntity both from client and server.

Running this function clientside will only set it for the client it is called on.

Arguments

1 string key
The key to associate the value with
2 Entity value
The value to set

Example

This will set the networked entity 'owner' on all clients to themselves.

for k, v in pairs( player.GetAll() ) do v:SetNWEntity( "owner", v ) end

Page Links


Special Pages


Wikis

?

Render Time: 30ms

Session 0
DB GetPage 3
Generate Html 4
SaveChanges 8
Render Body 0
Render Sidebar 7