[b][url=http://wiki.garrysmod.com/?title=VMatrix.Scale]VMatrix.Scale [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
I'm trying to make it so that heads dissapear on ragdolls when killed with a headshot but it only works until someone picks the ragdoll up or moves it then the head comes back. I'm using PostPlayerDraw and I tried PostDrawOpaqueRenderables but it just flickered a lot.
The proper place is Ragdoll.BuildBonePositions
Here's a snippet that makes your code compatible with other addons using that function (You have to define 'ragdoll' somewhere)
[lua]
local function YourFunc(ent)
--Do scale stuff here on 'ent'
end
if ragdoll.BuildBonePositions then
local old_Func = ragdoll.BuildBonePositions
ragdoll.BuildBonePositions = function(...)
old_Func(...)
YourFunc(...)
end
else
ragdoll.BuildBonePositions = YourFunc
end
[/lua]
Thanks ralle. Rated lua helper. :smile:
Sorry, you need to Log In to post a reply to this thread.