Hello Facepunch,
I've been working on a little project of my own, and it simply starts by everytime i run the script, it'll spawn a ragdoll on to a bed, sounds simple right?
Well, here it this thing, it seems if i make a bed and position the ragdoll onto it and then respawn that bed in another location around the map the ragdolls offset positions are not right ( as should be laying on the bed. )
Any solutions?
[LUA]
for _, v in pairs( ents.FindByClass("ent_hospitalbed") ) do
local ppAngle = Angle(-90,0,0)
local ppAdd = Vector(30,0,20)
local ragdoll = ents.Create( "prop_physics" )
ragdoll:SetModel( "models/Kleiner.mdl" )
ragdoll:SetPos( v:GetPos() + ppAdd )
ragdoll:SetAngles( v:GetAngles() + ppAngle )
ragdoll:SetParent( v )
ragdoll:Spawn()
timer.Simple(12, function()
ragdoll:Remove()
end)
end
[/LUA]
Thanks for your help.
If you're talking about the angle, as you are just adding ppAngle
Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Angle/RotateAroundAxis]Angle:RotateAroundAxis[/url]
You could try those:
[url]http://wiki.garrysmod.com/page/Entity/SetRagdollPos[/url]
[url]http://wiki.garrysmod.com/page/Entity/SetRagdollAng[/url]
Sorry, you need to Log In to post a reply to this thread.