Skip to content

CreateProp

Places a static mesh in the world.

An entity of ENTITY_PROP every client in range shows. mesh is a key of the mesh list; without the tables export only a path passes. scale is uniform (1 = the mesh’s own size); rigid makes it a physics body on each client (false = static); world is the virtual world (nil = the shared one). Nobody controls a prop, nobody mounts or takes it; DestroyEntity removes it, a reload removes them all. nil when the mesh resolves to nothing or the world is full.

CreateProp(mesh, x, y, z [, yaw, scale, rigid, world])
Parameter Type
mesh string | number the mesh’s id, file name or path
x number metres
y number metres
z number metres
yaw number degrees (0 without) (optional)
scale number uniform scale (1) (optional)
rigid boolean true = a pushable physics body on each client; false = static (optional)
world number the virtual world; nil = the shared one (optional)

number - the prop’s entity id; nil when it could not be made

-- an arena ring of barrels
for i = 0, 11 do
local a = math.rad(i * 30)
CreateProp("barrel_a", cx + math.cos(a) * 6, cy + math.sin(a) * 6, cz, i * 30)
end

GetMeshPath · FindMeshes · GetEntityScale · IsEntityRigid · DestroyEntity · the Props group of the index