Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local can = true
- script.Parent.Touched:Connect(function(hit)
- damage(hit)
- end)
- function damage(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- if hit.Parent.Name ~= script.Parent.Parent.Name and hit.Name ~= "DMGPart" then
- if hit.Parent.Humanoid.Health ~= 0 then
- if can then
- local vect = hit.Parent.HumanoidRootPart.Position + hit.Parent.HumanoidRootPart.CFrame.LookVector * 5
- local lookAt = hit.Parent.HumanoidRootPart.Position
- script.Parent.Del:Destroy()
- script.Parent.Parent.HumanoidRootPart.CFrame = CFrame.new(vect, lookAt)
- script.Parent.Parent.HumanoidRootPart.Anchored = true
- print("God 1")
- if hit.Parent.Humanoid.Health ~= 0 then
- can = false
- ani = hit.Parent.Humanoid:LoadAnimation(script.Animation)
- ani:Play()
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- ani2 = script.Parent.Parent.Humanoid:LoadAnimation(script.One)
- ani2:Play()
- hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- local exp = game.ReplicatedStorage.GodRadius.First.DMGPart:Clone()
- exp.Parent = workspace
- exp.Position = hit.Parent.HumanoidRootPart.Position
- exp.Sound:Play()
- hit.Parent.HumanoidRootPart.Anchored = true
- if hit.Parent.Humanoid:FindFirstChild("creator") then
- hit.Parent.Humanoid.creator:Destroy()
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- else
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- end
- hit.Parent.Humanoid:TakeDamage(script.DMG1.Value)
- end
- wait(0.5)
- if hit.Parent.Humanoid.Health == 0 then
- hit.Parent.HumanoidRootPart.Anchored = false
- script.Parent.Parent.HumanoidRootPart.Anchored = false
- else
- print("God 2")
- ani:Play()
- ani2:Play()
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- local exp2 = game.ReplicatedStorage.GodRadius.Second.DMGPart:Clone()
- exp2.Parent = workspace
- exp2.Position = hit.Parent.HumanoidRootPart.Position
- exp2.Sound:Play()
- hit.Parent.HumanoidRootPart.Anchored = true
- if hit.Parent.Humanoid:FindFirstChild("creator") then
- hit.Parent.Humanoid.creator:Destroy()
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- else
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- end
- hit.Parent.Humanoid:TakeDamage(script.DMG2.Value)
- end
- wait(0.5)
- if hit.Parent.Humanoid.Health == 0 then
- hit.Parent.HumanoidRootPart.Anchored = false
- script.Parent.Parent.HumanoidRootPart.Anchored = false
- else
- print("God 3")
- ani:Play()
- ani2:Play()
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- local exp3 = game.ReplicatedStorage.GodRadius.First.DMGPart:Clone()
- exp3.Parent = workspace
- exp3.Position = hit.Parent.HumanoidRootPart.Position
- exp3.Sound:Play()
- hit.Parent.HumanoidRootPart.Anchored = true
- if hit.Parent.Humanoid:FindFirstChild("creator") then
- hit.Parent.Humanoid.creator:Destroy()
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- else
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- end
- hit.Parent.Humanoid:TakeDamage(script.DMG1.Value)
- end
- wait(0.5)
- if hit.Parent.Humanoid.Health == 0 then
- hit.Parent.HumanoidRootPart.Anchored = false
- script.Parent.Parent.HumanoidRootPart.Anchored = false
- else
- print("God 2")
- ani:Play()
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- ani2:Play()
- hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- local exp2 = game.ReplicatedStorage.GodRadius.Second.DMGPart:Clone()
- exp2.Parent = workspace
- exp2.Position = hit.Parent.HumanoidRootPart.Position
- exp2.Sound:Play()
- hit.Parent.HumanoidRootPart.Anchored = true
- if hit.Parent.Humanoid:FindFirstChild("creator") then
- hit.Parent.Humanoid.creator:Destroy()
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- else
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- end
- hit.Parent.Humanoid:TakeDamage(script.DMG2.Value)
- end
- wait(0.5)
- if hit.Parent.Humanoid.Health == 0 then
- hit.Parent.HumanoidRootPart.Anchored = false
- script.Parent.Parent.HumanoidRootPart.Anchored = false
- else
- print("God 3")
- ani:Play()
- ani2:Play()
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
- local exp3 = game.ReplicatedStorage.GodRadius.First.DMGPart:Clone()
- exp3.Parent = workspace
- exp3.Position = hit.Parent.HumanoidRootPart.Position
- exp3.Sound:Play()
- hit.Parent.HumanoidRootPart.Anchored = true
- if hit.Parent.Humanoid:FindFirstChild("creator") then
- hit.Parent.Humanoid.creator:Destroy()
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- else
- local cr = Instance.new("ObjectValue")
- cr.Name = "creator"
- cr.Value = script.cr.Value
- cr.Parent = hit.Parent.Humanoid
- game.Debris:AddItem(cr,1) --0.1
- end
- hit.Parent.Humanoid:TakeDamage(script.DMG1.Value)
- end
- wait(0.5)
- local dsbl = game.ReplicatedStorage.Disabler:Clone()
- dsbl.Parent = hit.Parent
- script.Parent.Parent.HumanoidRootPart.Anchored = false
- hit.Parent.HumanoidRootPart.Anchored = false
- wait()
- script.Parent:Destroy()
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement