• how to make a ragdoll leave blood decals?
    8 replies, posted
Hi. I've been trying to do this for so long, but i cant get the util.decal to work. My request is something easy. How do i make it so that when i damage a ragdoll, it checks where i hit it and leaves a blood decal if he is close enough to the floor or wall??? Thanks!
Gore mod?
[QUOTE=freshmintyy;39863946]Gore mod?[/QUOTE] FFS im trying to make an addon, otherwise it wouldn't be in the modding help section
[QUOTE=buu342;39863710]Hi. I've been trying to do this for so long, but i cant get the util.decal to work. My request is something easy. How do i make it so that when i damage a ragdoll, it checks where i hit it and leaves a blood decal if he is close enough to the floor or wall??? Thanks![/QUOTE] Well the only way to do this is with util.Decal. Show us what you have and we will help you from there.
[code] function hiteffect( ent, dmginfo) if (ent:GetClass() == "prop_ragdoll" ) then local effect = EffectData() local origin = dmginfo:GetDamagePosition() effect:SetOrigin( origin ) util.Effect( "bloodimpact", effect ) local tr = util.TraceLine{ start = dmgpos,endpos = phys:GetPos() } local tr = util.TraceLine{ start = dmgpos,endpos = phys:GetPos() + Vector(0, 0, -50),filter = ent } util.Decal( "Blood", tr.HitPos + tr.HitNormal, tr.HitPos - tr.HitNormal ) end end hook.Add("EntityTakeDamage", "holyshit", hiteffect) [/code]
You never declared phys
[QUOTE=Hyper Iguana;39864310]You never declared phys[/QUOTE] this is what i was able to recover. I cant seem to find the older script. edit: this isn't the script, but its close. it doesn't work though [code] if(dmginfo:IsDamageType(DMG_CRUSH) or dmginfo:IsDamageType(DMG_FALL)) and (dmginfo:GetDamage() >= SlapDamage) then local effectdata = EffectData() local Pos1 = pos - pos:GetNormalized() local Pos2 = pos + pos:GetNormalized() effectdata:SetOrigin( pos ) effectdata:SetScale( 1 ) util.Decal("Blood", Pos1, Pos2) sound.Play( table.Random(bloodysounds), entpos, 100, 100 ) ParticleEffect("blood_impact_red_01",pos,Angle(0,0,0),nil) end [/code]
[img]http://i.imgur.com/NBt9Wrl.jpg[/img] [lua] hook.Add("EntityTakeDamage", "BloodEffects", function(ent, dmginfo) if ent:GetClass() == "prop_ragdoll" then local startp = dmginfo:GetDamagePosition() local traceinfo = {start = startp, endpos = startp - Vector(0,0,50), filter = ent, mask = MASK_NPCWORLDSTATIC} local trace = util.TraceLine(traceinfo) local todecal1 = trace.HitPos + trace.HitNormal local todecal2 = trace.HitPos - trace.HitNormal util.Decal("Blood", todecal1, todecal2) end end) [/lua]
thank you my friend! i owe you one!!! Closing! EDIT: Ohh i see what i did wrong Thank you x2!
Sorry, you need to Log In to post a reply to this thread.