Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.88 KB | None | 0 0
  1. local RedBloodEffect = {
  2. "blood_advisor_pierce_spray",
  3. "blood_advisor_pierce_spray_b",
  4. "blood_advisor_pierce_spray_c",
  5. "blood_advisor_puncture_withdraw",
  6. "blood_zombie_split_spray"}
  7.  
  8. local Playermodels = {
  9. "models/monstermash/deer_haunter.mdl",
  10. "models/monstermash/skeleton.mdl",
  11. "models/monstermash/guest.mdl",
  12. "models/monstermash/vampire.mdl",
  13. "models/monstermash/stein.mdl",
  14. "models/monstermash/witch.mdl",
  15. "models/monstermash.headless_horseman.mdl",
  16. "models/monstermash/mummy.mdl",
  17. "models/monstermash/scarecrow.mdl",
  18. "models/monstermash/nosferatu.mdl",
  19. "models/monstermash/bloody_mary.mdl"}
  20.  
  21. local Weps_CanDecapitate = {
  22. "mm_axe",
  23. "mm_battleaxe",
  24. "mm_scythe",
  25. "mm_sword"}
  26.  
  27. local Weps_CanBifurcate = {
  28. "mm_battleaxe",
  29. "mm_scythe"}
  30.  
  31. local meta = FindMetaTable("Player")
  32.  
  33. function meta:CreateRagdoll()
  34. end
  35.  
  36. function GM:PlayerDeathSound()
  37. return true
  38. end
  39.  
  40. function stuff(victim,inflictor,attacker)
  41. if !(victim == attacker) then
  42. attacker:SetNWInt("killcounter", attacker:GetNWInt("killcounter") + 1)
  43. end
  44. if victim:IsPlayer() then
  45. victim:ConCommand("play gameplay/death.wav")
  46. end
  47.  
  48. local ply_pos = victim:GetPos()
  49. local ply_ang = victim:GetAngles()
  50. local ply_mdl = victim:GetModel()
  51. local ply_skn = victim:GetSkin()
  52. local ply_col = victim:GetColor()
  53. local ply_mat = victim:GetMaterial()
  54. if victim.DamageTaken == nil then
  55. victim.DamageTaken = 0
  56. end
  57. if (IsValid(attacker) && !(victim == attacker) && attacker:IsPlayer() && IsValid(attacker:GetActiveWeapon()) && (attacker:GetActiveWeapon():GetClass() == "mm_shovel" )) then
  58. local ent = ents.Create("prop_dynamic")
  59. ent:SetPos(ply_pos)
  60. ent:SetAngles(ply_ang + Angle(0,180,0))
  61. ent:SetModel("models/misc/gravestone.mdl")
  62. ent:Spawn()
  63. ent:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  64. timer.Simple(60,function() if !IsValid(ent) then return end ent:Remove() end)
  65. elseif (IsValid(attacker) && !(victim == attacker) && attacker:IsPlayer() && IsValid(attacker:GetActiveWeapon()) && (attacker:GetActiveWeapon():GetClass() == "mm_battleaxe" || attacker:GetActiveWeapon():GetClass() == "mm_scythe") && victim.lastHitGroup && !(victim.lastHitGroup == HITGROUP_HEAD)) then
  66.  
  67.  
  68. local ent = ents.Create("prop_ragdoll")
  69. ent:SetPos(ply_pos+Vector(0,0,40))
  70. ent:SetAngles(ply_ang - Angle(ply_ang.p,0,-90))
  71. if ply_mdl == "models/monstermash/deer_haunter.mdl" then
  72. ent:SetModel("models/monstermash/gibs/deerhaunter_top.mdl")
  73. elseif ply_mdl == "models/monstermash/skeleton.mdl" then
  74. ent:SetModel("models/monstermash/gibs/skeleton_top.mdl")
  75. elseif ply_mdl == "models/monstermash/guest.mdl" then
  76. ent:SetModel("models/monstermash/gibs/guest_top.mdl")
  77. elseif ply_mdl == "models/monstermash/vampire.mdl" then
  78. ent:SetModel("models/monstermash/gibs/vampire_top.mdl")
  79. elseif ply_mdl == "models/monstermash/stein.mdl" then
  80. ent:SetModel("models/monstermash/gibs/stein_top.mdl")
  81. elseif ply_mdl == "models/monstermash/witch.mdl" then
  82. ent:SetModel("models/monstermash/gibs/witch_top.mdl")
  83. elseif ply_mdl == "models/monstermash/headless_horseman.mdl" then
  84. ent:SetModel("models/monstermash/gibs/hhm_top.mdl")
  85. elseif ply_mdl == "models/monstermash/mummy.mdl" then
  86. ent:SetModel("models/monstermash/gibs/mummy_top.mdl")
  87. elseif ply_mdl == "models/monstermash/scarecrow.mdl" then
  88. ent:SetModel("models/monstermash/gibs/scarecrow_top.mdl")
  89. elseif ply_mdl == "models/monstermash/nosferatu.mdl" then
  90. ent:SetModel("models/monstermash/gibs/nosferatu_top.mdl")
  91. elseif ply_mdl == "models/monstermash/bloody_mary.mdl" then
  92. ent:SetModel("models/monstermash/gibs/bm_top.mdl")
  93. end
  94. ent:SetSkin(ply_skn)
  95. ent:SetMaterial(ply_mat)
  96. ent:Spawn()
  97. ent:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  98. ent:SetBodygroup(1 ,0)
  99. ent:EmitSound("physics/flesh/flesh_bloody_break.wav")
  100. if ply_mdl == "models/monstermash/mummy.mdl" || ply_mdl == "models/monstermash/deer_haunter.mdl" || ply_mdl == "models/monstermash/vampire.mdl" || ply_mdl == "models/monstermash/stein.mdl" || ply_mdl == "models/monstermash/witch.mdl" || ply_mdl == "models/monstermash/nosferatu.mdl" || ply_mdl == "models/monstermash/bloody_mary.mdl" then
  101. local RandomBlood = table.Random(RedBloodEffect)
  102. local BloodTrail = ents.Create( "info_particle_system" )
  103. BloodTrail:SetKeyValue( "effect_name", RandomBlood )
  104. BloodTrail:SetKeyValue( "start_active", tostring( 1 ) )
  105. BloodTrail:SetPos( ply_pos+Vector(0,0,10) )
  106. BloodTrail:SetAngles( ply_ang )
  107. BloodTrail:SetParent(ent)
  108. BloodTrail:Spawn()
  109. BloodTrail:Activate()
  110. BloodTrail:Fire( "Kill", nil, 0.4 )
  111. end
  112.  
  113. if not ent:IsValid() then return end
  114. local plyvel = victim:GetVelocity()
  115.  
  116. for i = 1, ent:GetPhysicsObjectCount() do
  117. local bone = ent:GetPhysicsObjectNum(i)
  118. if bone and bone.IsValid and bone:IsValid() then
  119. local bonepos, boneang = victim:GetBonePosition(ent:TranslatePhysBoneToBone(i))
  120. bone:SetPos(bonepos)
  121. bone:SetAngles(boneang)
  122. bone:AddVelocity(plyvel)
  123. end
  124. end
  125.  
  126. if victim:IsOnFire() then ent:Ignite(math.Rand(6, 8), 0) end
  127. victim:SpectateEntity(ent)
  128. victim:Spectate(OBS_MODE_CHASE)
  129.  
  130. local ent2 = ents.Create("prop_ragdoll")
  131. ent2:SetPos(ply_pos)
  132. ent2:SetAngles(ply_ang - Angle(ply_ang.p,0,0))
  133. if ply_mdl == "models/monstermash/deer_haunter.mdl" then
  134. ent2:SetModel("models/monstermash/gibs/deerhaunter_lower.mdl")
  135. elseif ply_mdl == "models/monstermash/skeleton.mdl" then
  136. ent2:SetModel("models/monstermash/gibs/skeleton_lower.mdl")
  137. elseif ply_mdl == "models/monstermash/guest.mdl" then
  138. ent2:SetModel("models/monstermash/gibs/guest_lower.mdl")
  139. elseif ply_mdl == "models/monstermash/vampire.mdl" then
  140. ent2:SetModel("models/monstermash/gibs/vampire_lower.mdl")
  141. elseif ply_mdl == "models/monstermash/stein.mdl" then
  142. ent2:SetModel("models/monstermash/gibs/stein_lower.mdl")
  143. elseif ply_mdl == "models/monstermash/witch.mdl" then
  144. ent2:SetModel("models/monstermash/gibs/witch_lower.mdl")
  145. elseif ply_mdl == "models/monstermash/headless_horseman.mdl" then
  146. ent2:SetModel("models/monstermash/gibs/hhm_lower.mdl")
  147. elseif ply_mdl == "models/monstermash/mummy.mdl" then
  148. ent2:SetModel("models/monstermash/gibs/mummy_lower.mdl")
  149. elseif ply_mdl == "models/monstermash/scarecrow.mdl" then
  150. ent2:SetModel("models/monstermash/gibs/scarecrow_lower.mdl")
  151. elseif ply_mdl == "models/monstermash/nosferatu.mdl" then
  152. ent:SetModel("models/monstermash/gibs/nosferatu_lower.mdl")
  153. elseif ply_mdl == "models/monstermash/bloody_mary.mdl" then
  154. ent:SetModel("models/monstermash/gibs/bm_lower.mdl")
  155. end
  156. ent2:SetSkin(ply_skn)
  157. ent2:SetMaterial(ply_mat)
  158. ent2:Spawn()
  159. ent2:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  160. ent2:SetBodygroup(1 ,0)
  161.  
  162. if not ent2:IsValid() then return end
  163. local plyvel = victim:GetVelocity()
  164.  
  165. if victim:IsOnFire() then ent2:Ignite(math.Rand(6, 8), 0) end
  166. elseif ((IsValid(attacker) && !(victim == attacker) && attacker:IsPlayer() && IsValid(attacker:GetActiveWeapon()) && (attacker:GetActiveWeapon():GetClass() == "mm_axe" || attacker:GetActiveWeapon():GetClass() == "mm_hacksaw" || attacker:GetActiveWeapon():GetClass() == "mm_battleaxe" || attacker:GetActiveWeapon():GetClass() == "mm_scythe" || attacker:GetActiveWeapon():GetClass() == "mm_sword" || attacker:GetActiveWeapon():GetClass() == "mm_musketpistol" || attacker:GetActiveWeapon():GetClass() == "mm_repeater" || attacker:GetActiveWeapon():GetClass() == "mm_pumpshotgun" || attacker:GetActiveWeapon():GetClass() == "mm_sawedoff" ) && victim.lastHitGroup && (victim.lastHitGroup == HITGROUP_HEAD)) || (IsValid(attacker) && !(victim == attacker) && attacker:IsPlayer() && (attacker:GetActiveWeapon():GetClass() == "mm_knife") && victim.DamageTaken == 100)) then
  167.  
  168. local ent = ents.Create("sent_mm_body")
  169. ent:SetPos(ply_pos)
  170. ent:SetAngles(ply_ang - Angle(ply_ang.p,0,0))
  171. ent:SetModel(ply_mdl)
  172. ent:SetSkin(ply_skn)
  173. ent:SetMaterial(ply_mat)
  174. ent:Spawn()
  175. ent:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  176. if !(attacker:GetActiveWeapon():GetClass() == "mm_knife" ) then
  177. ent:SetBodygroup(1 ,1)
  178. end
  179. ent:SetSequence( ent:LookupSequence( "death_04" ) )
  180. ent:SetNWFloat("Time", CurTime() + 2)
  181. ent:EmitSound("physics/flesh/flesh_bloody_break.wav")
  182. if not ent:IsValid() then return end
  183. local plyvel = victim:GetVelocity()
  184.  
  185. for i = 1, ent:GetPhysicsObjectCount() do
  186. local bone = ent:GetPhysicsObjectNum(i)
  187. if bone and bone.IsValid and bone:IsValid() then
  188. local bonepos, boneang = victim:GetBonePosition(ent:TranslatePhysBoneToBone(i))
  189. bone:SetPos(bonepos)
  190. bone:SetAngles(boneang)
  191. bone:AddVelocity(plyvel)
  192. end
  193. end
  194. if attacker:GetActiveWeapon():GetClass() != "mm_knife" && (ply_mdl == "models/monstermash/mummy.mdl" || ply_mdl == "models/monstermash/deer_haunter.mdl" || ply_mdl == "models/monstermash/vampire.mdl" || ply_mdl == "models/monstermash/stein.mdl" || ply_mdl == "models/monstermash/witch.mdl" || ply_mdl == "models/monstermash/nosferatu.mdl" || ply_mdl == "models/monstermash/bloody_mary.mdl") then
  195. ent.DoBlood = true
  196. end
  197. if victim:IsOnFire() then ent:Ignite(math.Rand(6, 8), 0) end
  198. if !(attacker:GetActiveWeapon():GetClass() == "mm_knife" || attacker:GetActiveWeapon():GetClass() == "mm_musketpistol" || attacker:GetActiveWeapon():GetClass() == "mm_repeater" || attacker:GetActiveWeapon():GetClass() == "mm_pumpshotgun" || attacker:GetActiveWeapon():GetClass() == "mm_sawedoff") then
  199.  
  200.  
  201. if ply_mdl == "models/monstermash/mummy.mdl" || ply_mdl == "models/monstermash/deer_haunter.mdl" || ply_mdl == "models/monstermash/vampire.mdl" || ply_mdl == "models/monstermash/stein.mdl" || ply_mdl == "models/monstermash/witch.mdl" || ply_mdl == "models/monstermash/nosferatu.mdl" || ply_mdl == "models/monstermash/bloody_mary.mdl") then
  202. local RandomBlood = table.Random(RedBloodEffect)
  203. local BloodTrail = ents.Create( "info_particle_system" )
  204. BloodTrail:SetKeyValue( "effect_name", RandomBlood )
  205. BloodTrail:SetKeyValue( "start_active", tostring( 1 ) )
  206. BloodTrail:SetPos( ply_pos+Vector(0,0,20) )
  207. BloodTrail:SetAngles( ply_ang )
  208. BloodTrail:SetParent(ent)
  209. BloodTrail:Spawn()
  210. BloodTrail:Activate()
  211. BloodTrail:Fire( "Kill", nil, 0.4 )
  212. end
  213.  
  214.  
  215. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/head_deerhaunter.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  216. CreateGib("models/monstermash/skeleton.mdl","models/monstermash/gibs/head_skull.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  217. CreateGib("models/monstermash/guest.mdl","models/monstermash/gibs/head_skull.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  218. CreateGib("models/monstermash/vampire.mdl","models/monstermash/gibs/head_vampire.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  219. CreateGib("models/monstermash/stein.mdl","models/monstermash/gibs/head_stein.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  220. CreateGib("models/monstermash/witch.mdl","models/monstermash/gibs/head_witch.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  221. CreateGib("models/monstermash/headless_horseman.mdl","models/monstermash/gibs/head_pumpkin.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  222. CreateGib("models/monstermash/mummy.mdl","models/monstermash/gibs/head_mummy.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  223. CreateGib("models/monstermash/scarecrow.mdl","models/monstermash/gibs/head_scarecrow.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  224. CreateGib("models/monstermash/nosferatu.mdl","models/monstermash/gibs/head_nosferatu.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  225. CreateGib("models/monstermash/bloody_mary.mdl","models/monstermash/gibs/head_mary.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  226.  
  227. end
  228. if victim:IsOnFire() then ent2:Ignite(math.Rand(6, 8), 0) end
  229. victim:SpectateEntity(ent)
  230. victim:Spectate(OBS_MODE_CHASE)
  231. elseif (IsValid(inflictor) && inflictor:GetClass() == "ent_pumpkin_nade" || inflictor:GetClass() == "ent_cannonball") || (victim.DamageTaken > 119) then
  232.  
  233. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/head_deerhaunter.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  234. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/dh_gib_1.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  235. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/dh_gib_2.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  236. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/dh_gib_3.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  237. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/dh_gib_4.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  238. CreateGib("models/monstermash/deer_haunter.mdl","models/monstermash/gibs/dh_gib_5.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  239.  
  240. CreateGib("models/monstermash/skeleton.mdl","models/monstermash/gibs/head_skull.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  241. CreateGib("models/monstermash/guest.mdl","models/monstermash/gibs/head_skull.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  242.  
  243. CreateGib("models/monstermash/vampire.mdl","models/monstermash/gibs/head_vampire.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  244.  
  245. CreateGib("models/monstermash/stein.mdl","models/monstermash/gibs/head_stein.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  246.  
  247. CreateGib("models/monstermash/witch.mdl","models/monstermash/gibs/head_witch.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  248.  
  249. CreateGib("models/monstermash/headless_horseman.mdl","models/monstermash/gibs/head_pumpkin.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  250.  
  251. CreateGib("models/monstermash/mummy.mdl","models/monstermash/gibs/head_mummy.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  252.  
  253. CreateGib("models/monstermash/scarecrow.mdl","models/monstermash/gibs/head_scarecrow.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,false)
  254.  
  255. CreateGib("models/monstermash/nosferatu.mdl","models/monstermash/gibs/head_nosferatu.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  256.  
  257. CreateGib("models/monstermash/bloody_mary.mdl","models/monstermash/gibs/head_mary.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  258.  
  259. CreateGib(ply_mdl,"models/monstermash/gibs/gib_1.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  260. CreateGib(ply_mdl,"models/monstermash/gibs/gib_2.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  261. CreateGib(ply_mdl,"models/monstermash/gibs/gib_3.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  262. CreateGib(ply_mdl,"models/monstermash/gibs/gib_4.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  263. CreateGib(ply_mdl,"models/monstermash/gibs/gib_5.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  264. CreateGib(ply_mdl,"models/monstermash/gibs/gib_6.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  265. CreateGib(ply_mdl,"models/monstermash/gibs/gib_7.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  266. CreateGib(ply_mdl,"models/monstermash/gibs/gib_8.mdl",ply_pos+Vector(0,0,60),ply_ang - Angle(ply_ang.p,0,0),victim,true)
  267. for i=0,10 do
  268. local vPoint = ply_pos+Vector(0,0,60)
  269. local effectdata = EffectData()
  270. effectdata:SetOrigin( vPoint )
  271. util.Effect("bloodstream",effectdata)
  272. end
  273. elseif (IsValid(inflictor) && inflictor:GetClass() == "ent_cleaver") || (victim.DamageTaken > 119) then
  274. local ent = ents.Create("prop_ragdoll")
  275. ent:SetPos(ply_pos)
  276. ent:SetAngles(ply_ang - Angle(ply_ang.p,0,0))
  277. ent:SetModel(ply_mdl)
  278. ent:SetSkin(ply_skn)
  279. ent:SetMaterial(ply_mat)
  280. ent:Spawn()
  281. ent:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  282. ent:SetBodygroup(1 ,0)
  283.  
  284. local model = ents.Create("prop_physics")
  285. model:SetModel("models/weapons/monstermash/cleaver_headshot.mdl")
  286. model:SetPos(ent:GetPos()+Vector(0,0,0))
  287. model:SetAngles(ent:GetAngles())
  288. model:Spawn()
  289. model:FollowBone( ent, ent:LookupBone("ValveBiped.Bip01_Head1") )
  290. model:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  291.  
  292. else
  293. local ent = ents.Create("prop_ragdoll")
  294. ent:SetPos(ply_pos)
  295. ent:SetAngles(ply_ang - Angle(ply_ang.p,0,0))
  296. ent:SetModel(ply_mdl)
  297. ent:SetSkin(ply_skn)
  298. ent:SetMaterial(ply_mat)
  299. ent:Spawn()
  300. ent:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  301. ent:SetBodygroup(1 ,0)
  302. timer.Simple(60,function() if !IsValid(ent) then return end ent:Remove() end)
  303. if not ent:IsValid() then return end
  304. local plyvel = victim:GetVelocity()
  305.  
  306. for i = 1, ent:GetPhysicsObjectCount() do
  307. local bone = ent:GetPhysicsObjectNum(i)
  308. if bone and bone.IsValid and bone:IsValid() then
  309. local bonepos, boneang = victim:GetBonePosition(ent:TranslatePhysBoneToBone(i))
  310. bone:SetPos(bonepos)
  311. bone:SetAngles(boneang)
  312. bone:AddVelocity(plyvel)
  313. end
  314. end
  315.  
  316. if victim:IsOnFire() then ent:Ignite(math.Rand(6, 8), 0) end
  317. victim:SpectateEntity(ent)
  318. victim:Spectate(OBS_MODE_CHASE)
  319. end
  320. if (IsValid(attacker) && !(victim == attacker) && attacker:IsPlayer() && IsValid(attacker:GetActiveWeapon()) && (attacker:GetActiveWeapon():GetClass() == "mm_boner")) then
  321. local ent = ents.Create("item_healthkit")
  322. ent:SetPos(ply_pos)
  323. ent:SetAngles(ply_ang - Angle(ply_ang.p,0,0))
  324. ent:Spawn()
  325. end
  326. end
  327. hook.Add("PlayerDeath", "stuff", stuff)
  328.  
  329. function CreateGib(check,path,vector,angle,victim,dobleed)
  330. local ent2 = ents.Create("prop_physics")
  331. ent2:SetPos(vector)
  332. ent2:SetAngles(angle)
  333. if victim:GetModel() == check then
  334. ent2:SetModel(path)
  335. end
  336. ent2:SetSkin(victim:GetSkin())
  337. ent2:SetMaterial(victim:GetMaterial())
  338. ent2:Spawn()
  339. local num = math.Rand(1,3)
  340. if dobleed == true then
  341. for i = 0.1, num, 0.1 do
  342. timer.Simple(i,function()
  343. if !IsValid(ent2) then return end
  344. local effectdata = EffectData()
  345. effectdata:SetOrigin( ent2:GetPos() )
  346. util.Effect( "BloodImpact", effectdata )
  347. end)
  348. end
  349. if victim:IsOnFire() then ent2:Ignite(math.Rand(6, 8), 0) end
  350. local color = Color( 105, 0, 0, 255 )
  351. local trail = util.SpriteTrail(ent2, 0, color, false, 7, 1, 1, 1/(15+1)*0.5, "effects/bloodstream.vmt")
  352. end
  353.  
  354. ent2:SetCollisionGroup(COLLISION_GROUP_WEAPON or COLLISION_GROUP_DEBRIS_TRIGGER)
  355.  
  356. timer.Simple(25,function() if !IsValid(ent2) then return end ent2:Remove() end)
  357. end
  358.  
  359.  
  360. function stuff2( ply, HitGroup, dmginfo )
  361. ply.lastHitGroup = HitGroup
  362. /*local att = dmginfo:GetAttacker()
  363. if not att or not att:IsPlayer() then return end
  364. local wep = att:GetActiveWeapon()
  365. if wep:GetClass() == "mm_coachgun" then
  366. local leng = ply:GetPos():Distance( att:GetPos() )
  367. local scale = math.Clamp(leng,64, 512)
  368. local dmgscld = leng
  369. print(64/leng)
  370. dmginfo:ScaleDamage( 64/leng )
  371. else*/
  372. if not att or not att:IsPlayer() then return end
  373. local wep = att:GetActiveWeapon()
  374. if wep:GetClass() == "mm_huntingrifle" && HitGroup == HITGROUP_HEAD then
  375. dmginfo:ScaleDamage( 2 )
  376. else
  377. dmginfo:ScaleDamage( 1 )
  378. end
  379. end
  380. hook.Add("ScalePlayerDamage", "stuff2", stuff2)
  381.  
  382. function stuff3(ply)
  383. ply:RemoveAllDecals()
  384. end
  385. hook.Add("PlayerSpawn", "stuff3", stuff3)
  386.  
  387. function stuff4(victim,attacker,hpremain,dmgtaken)
  388.  
  389. if (victim == attacker) then
  390. victim.DamageTaken = 0
  391. else
  392. victim.DamageTaken = dmgtaken
  393. end
  394.  
  395. victim:DoReloadEvent()
  396.  
  397. end
  398. hook.Add("PlayerHurt","stuff4",stuff4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement