Is there any way to return Non-collide ragdoll by trace?
[code]
function SWEP:PrimaryAttack( )
local pos = self.Owner:GetShootPos()
local ang = self.Owner:GetAimVector()
local tracedata = {}
tracedata.start = pos
tracedata.endpos = pos+(ang*80)
tracedata.filter = self.Owner
local trace = util.TraceLine(tracedata)
if trace.HitNonWorld then
target = trace.Entity
if target:IsValid() then
target:Remove()
end
end
end
[/code]
This can destroy anything but no non-collide ragdolls. Why?
The so called "Non-collidable ragdolls" are clientside and do not exists on the server.
[QUOTE=kevkev;16580119]The so called "Non-collidable ragdolls" are clientside and do not exists on the server.[/QUOTE]
So how to destroy/hide them clientside?
[QUOTE=rute;16580173]So how to destroy/hide them clientside?[/QUOTE]
Entity(Indexofit):Remove()
[QUOTE=rute;16580173]So how to destroy/hide them clientside?[/QUOTE]
I think you'd have to do a trace on the client, which would simply entail rewriting the trace to work in the client-side .lua file (or IF CLIENT in the shared file for mavericks) aswell.
...but, I've never tested it, I'm probably wrong. Oh, and if it works it will probably only remove the ragdoll for the player using the SWep.
If the ragdoll [i]is[/i] clientside, and the PrimaryAttack function was in shared.lua, then there should be no problems.
I think the ragdoll ignores traces, you can use ent.GetAll() and filter through the ragdoll entities clientside (They are not called prop_ragdoll).
Sorry, you need to Log In to post a reply to this thread.