Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- hook.Add("TTTBeginRound","head_remove",function()
- for k,v in pairs(ents.FindByModel("models/Gibs/HGIBS.mdl")) do
- if v.isskull then
- v:Remove()
- end
- end
- end)
- if not pointadmin then pointadmin = {} end
- util.AddNetworkString("blua")
- function pointadmin.BroadcastLua(str)
- net.Start("blua")
- net.WriteString(str)
- net.Broadcast()
- end
- function game.GetServer() return "buildrp" end
- hook.Add("EntityTakeDamage", "decapitation", function( target, dmginfo )
- if not (target:IsPlayer() or target:GetClass() == "prop_ragdoll") then return end
- if not dmginfo:GetAttacker():IsPlayer() then return end
- if target.pa_god then return end
- local headpos = target:GetBonePosition(target:LookupBone("ValveBiped.Bip01_head1"))
- if IsValid(dmginfo:GetAttacker():GetActiveWeapon()) then
- if dmginfo:GetAttacker():GetActiveWeapon():GetClass() == "weapon_stunstick" then dmginfo:SetDamage(10) end
- if dmginfo:GetAttacker():GetActiveWeapon():GetClass() == "weapon_crowbar" then dmginfo:SetDamage(5) end
- end
- if dmginfo:GetDamagePosition():Distance(headpos) < 9 then dmginfo:ScaleDamage(10) end
- if (target:IsPlayer() and target:Alive() or true) and not target.Babygod and not target.decapped and dmginfo:GetDamagePosition():Distance(headpos) < 9 and target:Health() - dmginfo:GetDamage() <= 0 then
- local RF = RecipientFilter()
- for k,v in pairs(player.GetAll()) do
- if v:IsAdmin() then
- RF:AddPlayer(v)
- end
- end
- local infli = dmginfo:GetInflictor()
- local class = infli:IsPlayer() and dmginfo:GetInflictor():GetActiveWeapon() or NULL
- if IsValid(class) then class = class:GetClass() end
- if game.GetServer() == "buildrp" then
- -- umsg.Start("DRPLogMsg", RF)
- -- umsg.Short(255)
- -- umsg.Short(190)
- -- umsg.Short(0)
- -- umsg.String( (target:IsPlayer() and target:Name() or target:GetModel()).." was decapitated by "..(infli:Name()).." using "..(class).."." )
- -- umsg.End()
- if target:IsPlayer() then
- hook.Call("DoPlayerDeath", GAMEMODE, target, dmginfo:GetAttacker(), dmginfo)
- --pointadmin.SpawnEcho((target:IsPlayer() and target or target:GetModel()),Color(255, 255, 255)," ("..target:SteamID()..") was ",Color(255,85,85),"decapitated",Color(255, 255, 255)," by ",infli," with a "..class..".")
- --pointadmin.LogFile((target:IsPlayer() and target:Name() or target:GetModel()).." was decapitated by "..(infli:Name()).." using "..(class)..".\n")
- end
- end
- if not target:IsPlayer() then
- target:ManipulateBoneScale(target:LookupBone("ValveBiped.Bip01_head1"),Vector(0,0,0))
- end
- local skull = ents.Create("prop_physics")
- skull:SetModel("models/Gibs/HGIBS.mdl")
- skull:SetPos(headpos)
- skull:SetAngles(target:EyeAngles())
- skull:Spawn()
- skull:SetModelScale(1.25,0)
- skull.isskull = true
- skull:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER)
- skull:GetPhysicsObject():AddAngleVelocity(Vector(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000)))
- skull:SetNWString("killer",(target:IsPlayer() and target:Name() or target:GetNWString("nick","Someone")).."'s skull")
- skull:SetNWBool("skull",true)
- skull:SetNWInt("killtime",CurTime())
- if target:IsPlayer() then
- if game.GetServer() != "ttt" then
- target:CreateRagdoll()
- target:KillSilent()
- -- target:StripWeapons()
- -- target:Spectate( OBS_MODE_CHASE )
- -- target:SpectateEntity( skull )
- -- timer.Simple(5, function()
- -- if not IsValid(target) then return end
- -- target:Spawn()
- -- end)
- else
- end
- end
- local dir = headpos - dmginfo:GetAttacker():GetPos()
- dir:Normalize()
- skull:GetPhysicsObject():SetVelocity(dir*dmginfo:GetDamage())
- local r = math.random(2,4)
- for i = 1,10 do skull:EmitSound("physics/body/body_medium_break"..r..".wav",100,math.random(90,100)) end
- if game.GetServer() != "ttt" then
- timer.Simple(60,function()
- if not IsValid(skull) then return end
- if not skull.isskull then return end
- skull:Remove()
- end)
- else
- end
- -- kill me because im too fucking lazy to make a table
- local com = false
- local fem = false
- if string.find(target:GetModel(),"alyx") or string.find(target:GetModel(),"mossman") or string.find(target:GetModel(),"female") then
- fem = true
- end
- if string.find(target:GetModel(),"police") or string.find(target:GetModel(),"combine") or string.find(target:GetModel(),"soldier") then
- com = true
- end
- --if target:IsPlayer() then
- if string.find(target:GetModel(),"barney") then
- local r = math.random(1,9)
- for i = 1, 2 do target:EmitSound("vo/npc/barney/ba_pain0"..r..".wav",80) end
- elseif string.find(target:GetModel(),"alyx") then
- local r = math.random(1,3)
- for i = 1, 2 do target:EmitSound("vo/npc/alyx/no0"..r..".wav",80) end
- elseif string.find(target:GetModel(),"breen") then
- for i = 1, 2 do target:EmitSound("vo/citadel/br_no.wav",80) end
- elseif string.find(target:GetModel(),"kleiner") then
- for i = 1, 2 do target:EmitSound("vo/k_lab/kl_ahhhh.wav",80) end
- elseif string.find(target:GetModel(),"monk") then
- for i = 1, 2 do target:EmitSound("vo/ravenholm/monk_death07.wav",80) end
- elseif com then
- local r = math.random(1,4)
- for i = 1, 2 do target:EmitSound("npc/metropolice/die"..r..".wav",80) end
- elseif not fem then
- local r = math.random(1,5)
- for i = 1, 2 do target:EmitSound("player/crit_death"..r..".wav",80) end
- else
- for i = 1, 2 do target:EmitSound("ambient/voices/f_scream1.wav",80) end
- end
- if not target:IsPlayer() then
- target.decapped = true
- end
- if game.GetServer() == "ttt" then
- timer.Simple(0.1,function()
- if target:IsPlayer() then
- for k,v in pairs(ents.FindByClass("prop_ragdoll")) do
- if v:GetNWString("nick", "") == target:Name() then
- target = v
- target.decapped = true
- target:ManipulateBoneScale(target:LookupBone("ValveBiped.Bip01_head1"),Vector(0,0,0))
- end
- end
- end
- print(target)
- pointadmin.BroadcastLua([[
- timer.Simple(0.1,function()
- local ragdoll = Entity(]]..target:EntIndex()..[[)
- if ragdoll:IsPlayer() then
- ragdoll = ragdoll:GetRagdollEntity()
- end
- local skull = Entity(]]..skull:EntIndex()..[[)
- if IsValid(skull) then
- for i = 1, 256 do
- timer.Simple(i/32, function()
- if not IsValid(skull) then return end
- for i = 1, 2 do
- local x = (math.random(-100,100)/100) * 15
- local y = (math.random(-100,100)/100) * 15
- local z = (math.random(-100,100)/100) * 15
- util.Decal( "blood", skull:GetPos() + Vector(x,y,z), skull:GetPos() + Vector(x*2,y*2,z*2))
- end
- end)
- end
- for i = 1, 50 do
- timer.Simple(i/5, function()
- if not IsValid(skull) then return end
- local effectdata = EffectData()
- effectdata:SetOrigin( skull:GetPos() )
- for i = 1,1 do
- effectdata:SetOrigin( skull:GetPos() + Vector(math.random(-5,5),math.random(-5,5),math.random(-5,5)) )
- util.Effect( "bloodimpact", effectdata )
- end
- end)
- end
- end
- if not IsValid(ragdoll) then return end
- local headpos = ragdoll:GetBonePosition(ragdoll:LookupBone("ValveBiped.Bip01_head1"))
- local effectdata = EffectData()
- effectdata:SetOrigin( headpos )
- --for i = 1,1 do util.Effect( "Explosion", effectdata ) end
- for i = 1,25 do
- effectdata:SetOrigin( headpos + Vector(math.random(-15,15),math.random(-15,15),math.random(-15,15)) )
- util.Effect( "BloodImpact", effectdata )
- end
- for i = 1, 100 do
- timer.Simple(i/10, function()
- if not IsValid(ragdoll) then return end
- local pos = ragdoll:GetBonePosition(ragdoll:LookupBone("ValveBiped.Bip01_head1"))
- local effectdata = EffectData()
- effectdata:SetOrigin( pos )
- for i = 1,1 do
- effectdata:SetOrigin( pos + Vector(math.random(-5,5),math.random(-5,5),math.random(-5,5)) )
- util.Effect( "bloodimpact", effectdata )
- end
- end)
- end
- for i = 1, 256 do
- local x = (math.random(-100,100)/100) * 100
- local y = (math.random(-100,100)/100) * 100
- local z = (math.random(-100,100)/100) * 100
- util.Decal( "blood", headpos, headpos + Vector(x,y,z))
- end
- ragdoll:AddCallback("BuildBonePositions", function()
- local bone = ragdoll:LookupBone("ValveBiped.Bip01_Head1")
- local mat = ragdoll:GetBoneMatrix(bone)
- mat:Scale(Vector(0, 0, 0))
- ragdoll:SetBoneMatrix(ragdoll:LookupBone("ValveBiped.Bip01_Head1"), mat)
- ragdoll:ManipulateBoneScale(ragdoll:LookupBone("ValveBiped.Bip01_Head1"), Vector(0,0,0))
- end)
- end)
- ]])
- end)
- else
- pointadmin.BroadcastLua([[
- timer.Simple(0.1,function()
- local ragdoll = Entity(]]..target:EntIndex()..[[)
- if ragdoll:IsPlayer() then
- ragdoll = ragdoll:GetRagdollEntity()
- end
- local skull = Entity(]]..skull:EntIndex()..[[)
- if IsValid(skull) then
- for i = 1, 1024 do
- timer.Simple(i/32, function()
- if not IsValid(skull) then return end
- for i = 1, 2 do
- local x = (math.random(-100,100)/100) * 15
- local y = (math.random(-100,100)/100) * 15
- local z = (math.random(-100,100)/100) * 15
- util.Decal( "blood", skull:GetPos() + Vector(x,y,z), skull:GetPos() + Vector(x*2,y*2,z*2))
- end
- end)
- end
- for i = 1, 50 do
- timer.Simple(i/5, function()
- if not IsValid(skull) then return end
- local effectdata = EffectData()
- effectdata:SetOrigin( skull:GetPos() )
- for i = 1,1 do
- effectdata:SetOrigin( skull:GetPos() + Vector(math.random(-5,5),math.random(-5,5),math.random(-5,5)) )
- util.Effect( "bloodimpact", effectdata )
- end
- end)
- end
- end
- if not IsValid(ragdoll) then return end
- local headpos = ragdoll:GetBonePosition(ragdoll:LookupBone("ValveBiped.Bip01_head1"))
- local effectdata = EffectData()
- effectdata:SetOrigin( headpos )
- --for i = 1,1 do util.Effect( "Explosion", effectdata ) end
- for i = 1,25 do
- effectdata:SetOrigin( headpos + Vector(math.random(-15,15),math.random(-15,15),math.random(-15,15)) )
- util.Effect( "BloodImpact", effectdata )
- end
- for i = 1, 100 do
- timer.Simple(i/10, function()
- if not IsValid(ragdoll) then return end
- local pos = ragdoll:GetBonePosition(ragdoll:LookupBone("ValveBiped.Bip01_head1"))
- local effectdata = EffectData()
- effectdata:SetOrigin( pos )
- for i = 1,1 do
- effectdata:SetOrigin( pos + Vector(math.random(-5,5),math.random(-5,5),math.random(-5,5)) )
- util.Effect( "bloodimpact", effectdata )
- end
- end)
- end
- for i = 1, 256 do
- local x = (math.random(-100,100)/100) * 100
- local y = (math.random(-100,100)/100) * 100
- local z = (math.random(-100,100)/100) * 100
- util.Decal( "blood", headpos, headpos + Vector(x,y,z))
- end
- ragdoll:AddCallback("BuildBonePositions", function()
- local bone = ragdoll:LookupBone("ValveBiped.Bip01_Head1")
- local mat = ragdoll:GetBoneMatrix(bone)
- mat:Scale(Vector(0, 0, 0))
- ragdoll:SetBoneMatrix(ragdoll:LookupBone("ValveBiped.Bip01_Head1"), mat)
- ragdoll:ManipulateBoneScale(ragdoll:LookupBone("ValveBiped.Bip01_Head1"), Vector(0,0,0))
- end)
- end)
- ]])
- end
- end
- return dmginfo
- end)
- else
- net.Receive("blua", function() RunString(net.ReadString()) end)
- hook.Add("HUDDrawTargetID","DrawSkull",function()
- local ply = LocalPlayer():GetEyeTrace().Entity
- if IsValid(ply) then
- if ply:GetNWBool("skull",false) then
- draw.SimpleText( ply:GetNWString("killer","Unidentified Skull"), "TargetID", (ScrW()/2) + 1, (ScrH()/2)+11, COLOR_BLACK, TEXT_ALIGN_CENTER )
- draw.SimpleText( ply:GetNWString("killer","Unidentified Skull"), "TargetID", (ScrW()/2), (ScrH()/2)+10, COLOR_WHITE, TEXT_ALIGN_CENTER )
- if not pointadmin then return end
- local text = ply:GetNWInt("killtime",0) == 0 and "" or "Dismembered "..(CurTime() - ply:GetNWInt("killtime",0)).." seconds ago."
- draw.SimpleText( text, "TargetID", (ScrW()/2) + 1, (ScrH()/2)+38, COLOR_BLACK, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
- draw.SimpleText( text, "TargetID", (ScrW()/2), (ScrH()/2)+37, COLOR_WHITE, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement