Advertisement
IHATEMICROWAVEOVEN

type advantages 4

Nov 23rd, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. function DamageService:RegisterRangeDamage(Handler, Range, Damage, OnHitFunc, Type)
  2. spawn(function()
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. local attacktype
  14. if not Type then attacktype = None else
  15. local tupe = string.upper(tostring(Type))
  16. if tupe == "1" or tupe == "NOR" or tupe == "NORMAL" then attacktype = Normal end
  17. if tupe == "2" or tupe == "FIR" or tupe == "FIRE" then attacktype = Fire end
  18. if tupe == "3" or tupe == "WAT" or tupe == "WATER" then attacktype = Water end
  19. if tupe == "4" or tupe == "ELE" or tupe == "ELECTRIC" then attacktype = Electric end
  20. if tupe == "5" or tupe == "GRA" or tupe == "GRASS" then attacktype = Grass end
  21. if tupe == "6" or tupe == "ICE" then attacktype = Ice end
  22. if tupe == "7" or tupe == "FIG" or tupe == "FIGHTING" then attacktype = Fighting end
  23. if tupe == "8" or tupe == "POI" or tupe == "POISON" then attacktype = Poison end
  24. if tupe == "9" or tupe == "GRO" or tupe == "GROUND" then attacktype = Ground end
  25. if tupe == "10" or tupe == "FLY" or tupe == "FLYING" then attacktype = Flying end
  26. if tupe == "11" or tupe == "PSY" or tupe == "PSYCHIC" then attacktype = Psychic end
  27. if tupe == "12" or tupe == "BUG" then attacktype = Bug end
  28. if tupe == "13" or tupe == "ROC" or tupe == "ROCK" then attacktype = Rock end
  29. if tupe == "14" or tupe == "GHO" or tupe == "GHOST" then attacktype = Ghost end
  30. if tupe == "15" or tupe == "DRA" or tupe == "DRAGON" then attacktype = Dragon end
  31. if tupe == "16" or tupe == "DAR" or tupe == "DARK" then attacktype = Dark end
  32. if tupe == "17" or tupe == "STE" or tupe == "STEEL" then attacktype = Steel end
  33. if tupe == "18" or tupe == "FAI" or tupe == "FAIRY" then attacktype = Fairy end
  34. if attacktype == nil then attacktype = None end
  35. end
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. for _, plr in pairs(game.Players:GetPlayers()) do
  47. if plr.Character and Handler.Character then
  48. if plr.Character:FindFirstChild("Torso") and Handler.Character:FindFirstChild("Torso") then
  49. if (Handler.Character.Torso.Position - plr.Character.Torso.Position).magnitude <= Range then
  50. if DamageService:RegisterDamage(Handler, plr, Damage, attacktype) and OnHitFunc then
  51. OnHitFunc(plr)
  52. end
  53. end
  54. end
  55. end
  56. end
  57. for _, boss in pairs(BOSS_HOLDER:GetChildren()) do
  58. if boss:IsA'Model' then
  59. if boss:FindFirstChild("Torso") then
  60. if (boss.Torso.Position - Handler.Character.Torso.Position).magnitude <= Range then
  61. if DamageService:RegisterDamage(Handler, boss, Damage) and OnHitFunc then
  62. OnHitFunc(boss)
  63. end
  64. end
  65. end
  66. end
  67. end
  68. end)
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement