Hello, I'm relatively new to GMod Lua but already have decent understanding of Lua on its own..
I'm trying to spawn an office chair at my player's position that is frozen, however I can't get it to freeze..
local chair1 = ents.Create ("prop_physics")
chair1:SetModel ("models/props/cs_office/Chair_office.mdl")
chair1:SetPos(ply:GetPos())
chair1:SetAngles (ply:EyeAngles())
chair1:Spawn()
I've tried using "chair1:EnableMotion(false)", which I found on the wiki, however that just says that :EnableMotion(false) is a nil value..
Could someone please explain how to properly spawn a frozen prop?
[b][url=http://wiki.garrysmod.com/?title=PhysObj.EnableMotion]PhysObj.EnableMotion [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] is used on the PhysObj of the entity, not the entity itself.
[lua]
-- taken straight from the wiki
local phys = chair1:GetPhysicsObject()
if phys and phys:IsValid() then
phys:EnableMotion(false) -- Freezes the object in place.
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.