Unnamed
public lua v1 · immutableif v:InVehicle() then local vehicle = v:GetParent() v:ExitVehicle() end local ragdoll = ents.Create( "prop_ragdoll" ) ragdoll:SetPos( v:GetPos() ) ragdoll:SetModel( v:GetModel() ) ragdoll:Spawn() ragdoll:Activate() v:Spectate( OBS_MODE_CHASE ) v:SpectateEntity( ragdoll ) v:StripWeapons() -- Otherwise they can still use the weapons. ragdoll:DisallowDeleting( true ) v:DisallowSpawning( true ) v.ragdoll = ragdoll