Garry's Mod Wiki

Garry's Mod Wiki

  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.

There's a 4096 slots Network limit. If you need more, consider using the net library or Entity:SetNW2Entity. You should also consider the fact that you have way too many variables. You can learn more about this limit here: Networking_Usage
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 i, ply in ipairs( player.GetAll() ) do ply:SetNWEntity( "owner", ply ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...