scripted_ents.GetStored

From Garry's Mod
Jump to: navigation, search
 scripted_ents.GetStored( )

Contents

Description

Returns the actual ENT table for a class. Modifying functions/variables in this table will change newly spawned entities

Arguments

string classname

The classname of the ENT table to return

Returns

table

entTable

Examples

Example

Modifies all newly spawned gmod_button's to print a message on use

local ENT = scripted_ents.GetStored("gmod_button").t
local oldUse = ENT.Use
function ENT:Use(activator, caller, type, value)
 print(tostring(self.Entity).." just got pressed!")
 oldUse(self,activator, caller, type, value)
end


Personal tools
Navigation