Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DamageService:RegisterRangeDamage(Handler, Range, Damage, OnHitFunc, Type)
- spawn(function()
- local attacktype
- if not Type then attacktype = None else
- local tupe = string.upper(tostring(Type))
- if tupe == "1" or tupe == "NOR" or tupe == "NORMAL" then attacktype = Normal end
- if tupe == "2" or tupe == "FIR" or tupe == "FIRE" then attacktype = Fire end
- if tupe == "3" or tupe == "WAT" or tupe == "WATER" then attacktype = Water end
- if tupe == "4" or tupe == "ELE" or tupe == "ELECTRIC" then attacktype = Electric end
- if tupe == "5" or tupe == "GRA" or tupe == "GRASS" then attacktype = Grass end
- if tupe == "6" or tupe == "ICE" then attacktype = Ice end
- if tupe == "7" or tupe == "FIG" or tupe == "FIGHTING" then attacktype = Fighting end
- if tupe == "8" or tupe == "POI" or tupe == "POISON" then attacktype = Poison end
- if tupe == "9" or tupe == "GRO" or tupe == "GROUND" then attacktype = Ground end
- if tupe == "10" or tupe == "FLY" or tupe == "FLYING" then attacktype = Flying end
- if tupe == "11" or tupe == "PSY" or tupe == "PSYCHIC" then attacktype = Psychic end
- if tupe == "12" or tupe == "BUG" then attacktype = Bug end
- if tupe == "13" or tupe == "ROC" or tupe == "ROCK" then attacktype = Rock end
- if tupe == "14" or tupe == "GHO" or tupe == "GHOST" then attacktype = Ghost end
- if tupe == "15" or tupe == "DRA" or tupe == "DRAGON" then attacktype = Dragon end
- if tupe == "16" or tupe == "DAR" or tupe == "DARK" then attacktype = Dark end
- if tupe == "17" or tupe == "STE" or tupe == "STEEL" then attacktype = Steel end
- if tupe == "18" or tupe == "FAI" or tupe == "FAIRY" then attacktype = Fairy end
- if attacktype == nil then attacktype = None end
- end
- for _, plr in pairs(game.Players:GetPlayers()) do
- if plr.Character and Handler.Character then
- if plr.Character:FindFirstChild("Torso") and Handler.Character:FindFirstChild("Torso") then
- if (Handler.Character.Torso.Position - plr.Character.Torso.Position).magnitude <= Range then
- if DamageService:RegisterDamage(Handler, plr, Damage, attacktype) and OnHitFunc then
- OnHitFunc(plr)
- end
- end
- end
- end
- end
- for _, boss in pairs(BOSS_HOLDER:GetChildren()) do
- if boss:IsA'Model' then
- if boss:FindFirstChild("Torso") then
- if (boss.Torso.Position - Handler.Character.Torso.Position).magnitude <= Range then
- if DamageService:RegisterDamage(Handler, boss, Damage) and OnHitFunc then
- OnHitFunc(boss)
- end
- end
- end
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement