local I=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local x=require((I:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"))local u=x:GetResource("\069\120\116\101\114\110\097\108\085\116\105\108\046\078\101\120\117\115\073\110\115\116\097\110\099\101\046\078\101\120\117\115\079\098\106\101\099\116")local U=u:Extend()U:SetClassName("\066\111\109\098\065\116\116\097\099\107")function U.PerformServerAttack(I,x,u)local U=I.Character if U then local I=U:FindFirstChild("\072\117\109\097\110\111\105\100")local u=U:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if I and(I.Health>0 and u)then local I=Instance.new("\080\097\114\116")I.Size=Vector3.new(1,1,1)I.CFrame=u.CFrame*CFrame.new(0,0,-2)I.Parent=x local U=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")U.MeshType=Enum.MeshType.FileMesh U.Scale=Vector3.new(2,2,2)U.TextureId="\114\098\120\097\115\115\101\116\105\100\058\047\047\051\055\054\048\054\056\049\052"U.MeshId="\114\098\120\097\115\115\101\116\105\100\058\047\047\051\055\050\050\051\055\056\055"U.Parent=I local k=Instance.new("\070\105\114\101")k.Parent=I local R=true I.Touched:Connect(function(u)local U=u.Parent if R and(U and U:IsDescendantOf(x))then local u=U:FindFirstChild("\072\117\109\097\110\111\105\100")if u and u.Health>0 then R=false I:Destroy()local u=Instance.new("\069\120\112\108\111\115\105\111\110")u.BlastRadius=5 u.BlastPressure=0 u.DestroyJointRadiusPercent=0 u.Position=I.Position local U={}u.Hit:Connect(function(I,u)local k=I.Parent if k and k:IsDescendantOf(x)then local I=k:FindFirstChild("\072\117\109\097\110\111\105\100")if I and not U[I]then U[I]=true I:TakeDamage((u/5)*100)end end end)u.Parent=x end end end)end end end return U
--[[
TheNexusAvenger

Attack for a bomb.
Class is static (should not be created).
--]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ReplicatedStorage"))

local NexusObject = ReplicatedStorageProject:GetResource("ExternalUtil.NexusInstance.NexusObject")

local BombAttack = NexusObject:Extend()
BombAttack:SetClassName("BombAttack")



--[[
Performs the attack on the server.
--]]
function BombAttack.PerformServerAttack(Player,DungeonModel,Target)
    local Character = Player.Character
    if Character then
        local Humanoid = Character:FindFirstChild("Humanoid")
        local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
        if Humanoid and Humanoid.Health > 0 and HumanoidRootPart then
            --Create the bomb.
            local PumpkinBomb = Instance.new("Part")
            PumpkinBomb.Size = Vector3.new(1,1,1)
            PumpkinBomb.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
            PumpkinBomb.Parent = DungeonModel
            
            local Mesh = Instance.new("SpecialMesh")
            Mesh.MeshType = Enum.MeshType.FileMesh
            Mesh.Scale = Vector3.new(2,2,2)
            Mesh.TextureId = "rbxassetid://37606814"
            Mesh.MeshId = "rbxassetid://37223787"
            Mesh.Parent = PumpkinBomb

            local Fire = Instance.new("Fire")
            Fire.Parent = PumpkinBomb

            --Connect exploding the bomb.
            local DB = true
            PumpkinBomb.Touched:Connect(function(TouchPart)
                local MonsterCharacter = TouchPart.Parent
                if DB and MonsterCharacter and MonsterCharacter:IsDescendantOf(DungeonModel) then
                    local MonsterHumanoid = MonsterCharacter:FindFirstChild("Humanoid")
                    if MonsterHumanoid and MonsterHumanoid.Health > 0 then
                        DB = false

                        --Explode the bomb.
                        PumpkinBomb:Destroy()
                        local Explosion = Instance.new("Explosion")
                        Explosion.BlastRadius = 5
                        Explosion.BlastPressure = 0
                        Explosion.DestroyJointRadiusPercent = 0
                        Explosion.Position = PumpkinBomb.Position
                        local HitMonsters = {}
                        Explosion.Hit:Connect(function(HitPart,Radius)
                            local HitMonsterCharacter = HitPart.Parent
                            if HitMonsterCharacter and HitMonsterCharacter:IsDescendantOf(DungeonModel) then
                                local HitMonsterHumanoid = HitMonsterCharacter:FindFirstChild("Humanoid")
                                if HitMonsterHumanoid and not HitMonsters[HitMonsterHumanoid] then
                                    HitMonsters[HitMonsterHumanoid] = true
                                    HitMonsterHumanoid:TakeDamage((Radius/5) * 100)
                                end
                            end
                        end)
                        Explosion.Parent = DungeonModel
                    end
                end
            end)
        end
    end
end



return BombAttack