ents.CreateClientProp

From Garry's Mod
Jump to: navigation, search
 ents.CreateClientProp( )

Contents

Description

Creates a clientside only prop. See also ClientsideModel.

BUG

Clientside entities are not garbage-collected, thus you must store a reference to the object and call CSEnt:Remove manually.

Issue Tracker: #1387

BUG

Projected textures do not work on clientside props under specific conditions (see this explanation).

Issue Tracker: #3268

Arguments

string model="models/error.mdl"

The model for the entity to be created.

WARNING

Model must be precached with util.PrecacheModel on the server before usage.

Returns

CSEnt

Created entity.

Examples

Example

Creates a clientside prop at the player location.

function GhostBarrel( ply )
	local c_Model = ents.CreateClientProp()
	c_Model:SetPos( ply:GetPos() )
	c_Model:SetModel( "models/props_borealis/bluebarrel001.mdl" )
	c_Model:SetParent( ply )
	c_Model:Spawn()
end


Personal tools
Navigation