Garry's Mod Wiki

ents.CreateClientProp

Entity ents.CreateClientProp( string model = "models/error.mdl" )

Description

Creates a clientside only prop. See also ClientsideModel.

For physics to work you must use the model argument, a simple SetModel call will not be enough.

Arguments

1 string model = "models/error.mdl"
The model for the entity to be created.

Returns

1 Entity
Created entity. (C_PhysPropClientside)

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

Example

Creates a clientside prop with physics.

concommand.Add( "testent", function( ply ) local plyTr = ply:GetEyeTrace() csEnt = ents.CreateClientProp( "models/props_combine/combine_light001b.mdl" ) csEnt:SetPos( plyTr.HitPos + plyTr.HitNormal * 24 ) csEnt:Spawn() end )

Page Links


Special Pages


Wikis

?

Render Time: 82ms

DB GetPage 42
Generate Html 6
SaveChanges (1) 12
Render Body 0
Render Sidebar 20