Garry's Mod Wiki

Garry's Mod Wiki

  ENTITY:SetupDataTables()

Description

Called when the entity should set up its Data Tables.

This is a much better option than using Set/Get Networked Values.

This hook is called after GM:OnEntityCreated and GM:NetworkEntityCreated.

Example

Sets up networked variables, adds functions SetAmount, GetAmount, GetBloodPos, SetBloodPos, GetUrinePos, SetUrinePos.

This function only supports 32 data tables per type (#0-31), except for strings which only supports 4 (#0-3).

function ENT:SetupDataTables() self:NetworkVar( "Float", 0, "Amount" ) self:NetworkVar( "Vector", 0, "BloodPos" ) self:NetworkVar( "Vector", 1, "UrinePos" ) if SERVER then self:SetAmount( 3 ) self:SetBloodPos( Vector( 0, -32, 0 ) ) self:SetUrinePos( Vector( 0, 0, -16 ) ) end 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 four times a day. Edits and history are not available.

Last Parsed: Loading...