Entity Dissolve

Theme closed

why are you trying to check if the player is aiming a prop

I’m didn’t know how to do another…
Pls help! If player die, his corpse remove(by dissolver)

okay, let’s calm down, first…Let me make some questions

  1. Ragdoll being removed is okay?
  2. Other stuff being removed is okay?

This script remove props, ragdoll(spawned by q-menu). I need script, that remove(by dissolver entity) player corpse when he dead.

On PlayerDeath, if the damage type is DMG_DISSOLVE or so, you can avoid spawning a ragdoll, if that is what you’re asking?

No, I want to player corpse remove(by dissolver) if player dead

I believe what UnkN is asking is regardless of how a player dies, the ragdoll should dissolve.

I don’t think that’s possible in sandbox since player ragdoll is created on the client by default.

In Deathrun gamemode, no sandbox

It uses same method.

DoPlayerDeath in Deathrun calls DoPlayerDeath from the Base gamemode, which is where the ragdoll gets made. Possible solution would be to copy the function from the base gamemode and modify it to make a serverside ragdoll, then modify the function in deathrun to call the new function instead of the base one.

[lua]
–This is a copy of the DoPlayerDeath hook from the base gamemode
function GM:DoPlayerDeath( ply, attacker, dmginfo )
ply:CreateRagdoll() --CHANGE THIS TO MAKE A SERVERSIDE RAGDOLL
ply:AddDeaths( 1 )
if ( attacker:IsValid() && attacker:IsPlayer() ) then
if ( attacker == ply ) then
attacker:AddFrags( -1 )
else
attacker:AddFrags( 1 )
end
end
end[/lua]

Find the line in init.lua for DeathRun that looks like:
[lua]function GM:DoPlayerDeath( ply, attacker, cinfo )

self.BaseClass:DoPlayerDeath( ply, attacker, cinfo )

local num = 0[/lua]

Paste the above function above that (and optionally make it local to the file). Then change self.BaseClass:DoPlayerDeath to be your new function.

[lua]–This is the DoPlayerDeath hook copied from the base gamemode so we can customise it to make serverside ragdolls
local function Base_DoPlayerDeath_Customised( ply, attacker, dmginfo )
ply:CreateRagdoll() --YOU NEED TO CHANGE THIS TO MAKE A SERVERSIDE RAGDOLL
ply:AddDeaths( 1 )
if ( attacker:IsValid() && attacker:IsPlayer() ) then
if ( attacker == ply ) then
attacker:AddFrags( -1 )
else
attacker:AddFrags( 1 )
end
end
end

–The original (now modified) deathrun code is below
function GM:DoPlayerDeath( ply, attacker, cinfo )

Base_DoPlayerDeath_Customised( ply, attacker, cinfo )

local num = 0[/lua]

Finally, replace ply:CreateRagdoll() with a function that makes a serverside ragdoll.

EDIT: I have no idea which DeathRun is the one you or anyone is using, this was the top of google for me so I assume that’s it https://github.com/Mr-Gash/GMod-Deathrun/blob/master/deathrun/gamemode/init.lua

Thanks to all, I do script.



		ply:CreateRagdoll()
		local corpse = ply:GetRagdollEntity(  )


and use it.