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("\083\112\105\100\101\114\087\101\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=x:WaitForChild("\071\114\111\117\110\100")local U=Instance.new("\080\097\114\116")U.BrickColor=BrickColor.new("\073\110\115\116\105\116\117\116\105\111\110\097\108 \119\104\105\116\101")U.Anchored=true U.Size=Vector3.new(8,.2,8)U.CFrame=CFrame.new(u.CFrame.X,(I.CFrame.Y+I.Size.Y/2)+.1,u.CFrame.Z)U.Parent=x local k=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")k.MeshType=Enum.MeshType.FileMesh k.Scale=Vector3.new(.00125,.00125,.00125)k.MeshId="\114\098\120\097\115\115\101\116\105\100\058\047\047\053\049\057\048\057\055\057\057\052"k.Parent=U local R={}local p=false U.Touched:Connect(function(I)local u=I.Parent if u and u:IsDescendantOf(x)then local I=u:FindFirstChild("\072\117\109\097\110\111\105\100")if I and(I.Health>0 and not R[I])then R[I]=true I.WalkSpeed=0 if not p then p=true wait(5)for I,x in pairs(R)do I.WalkSpeed=16 end U:Destroy()end end end end)end end end return U
--[[
TheNexusAvenger

Attack for a spider web.
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 SpiderWebAttack = NexusObject:Extend()
SpiderWebAttack:SetClassName("SpiderWebAttack")



--[[
Performs the attack on the server.
--]]
function SpiderWebAttack.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 web.
            local Ground = DungeonModel:WaitForChild("Ground")
            local SpiderWebPart = Instance.new("Part")
            SpiderWebPart.BrickColor = BrickColor.new("Institutional white")
            SpiderWebPart.Anchored = true
            SpiderWebPart.Size = Vector3.new(8,0.2,8)
            SpiderWebPart.CFrame = CFrame.new(HumanoidRootPart.CFrame.X,Ground.CFrame.Y + (Ground.Size.Y/2) + 0.1,HumanoidRootPart.CFrame.Z)
            SpiderWebPart.Parent = DungeonModel
            
            local SpiderWebMesh = Instance.new("SpecialMesh")
            SpiderWebMesh.MeshType = Enum.MeshType.FileMesh
            SpiderWebMesh.Scale = Vector3.new(0.00125,0.00125,0.00125)
            SpiderWebMesh.MeshId = "rbxassetid://519097994"
            SpiderWebMesh.Parent = SpiderWebPart

            --Connect exploding the bomb.
            local HitMonsters = {}
            local DestroyWebStarted = false
            SpiderWebPart.Touched:Connect(function(TouchPart)
                local MonsterCharacter = TouchPart.Parent
                if MonsterCharacter and MonsterCharacter:IsDescendantOf(DungeonModel) then
                    local MonsterHumanoid = MonsterCharacter:FindFirstChild("Humanoid")
                    if MonsterHumanoid and MonsterHumanoid.Health > 0 and not HitMonsters[MonsterHumanoid] then
                        --Stop the monster.
                        HitMonsters[MonsterHumanoid] = true
                        MonsterHumanoid.WalkSpeed = 0

                        --Destroy the web if it wasn't started already.
                        if not DestroyWebStarted then
                            DestroyWebStarted = true
                            wait(5)
                            for HitMonsterHumanoid,_ in pairs(HitMonsters) do
                                HitMonsterHumanoid.WalkSpeed = 16
                            end
                            SpiderWebPart:Destroy()
                        end
                    end
                end
            end)
        end
    end
end



return SpiderWebAttack