Hello.
Some of you have seen my game war on the sea.
I am making a better explosion script
It just seems too excessive and I feel like it could be a LOT smaller.
Thanks.
repeat
wait()
until script.Parent.Health.Value <= 0
script.Parent.PatrolAi:Destroy()
script.Parent.Enabler:Destroy()
script.Parent.qPerfectionWeld:Destroy()
script.Parent.Escort:Destroy()
script.Parent.Name = "PileOfDestroyedJunk"
script.Parent.Parent = workspace
script.Parent:BreakJoints()
local explosion = Instance.new("Explosion")
explosion.DestroyJointRadiusPercent = 0
explosion.BlastPressure = 5000000
explosion.Position = script.Parent.BluePlane.Position
explosion.Parent = workspace
local TeamManager = require(game:GetService("ServerScriptService").MainGameScript.GameManager.TeamManager)
TeamManager:AddTeamScore(game:GetService("Teams").Red.TeamColor, 1)
for v,Part in pairs(script.Parent:GetDescendants()) do
if Part:IsA("BasePart") then
local fire = Instance.new("Fire")
fire.Parent = Part
fire.Size = 15
end
end
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("BasePart") then
v.Touched:connect(function(part)
if part.Name == "Terrain" or (part:FindFirstAncestor("RedShips")) then
local health = part.Parent:FindFirstChild("Health")
health.Value = health.Value - math.random(1,15)
local explosion = Instance.new("Explosion")
explosion.Position = v.Position
explosion.BlastRadius = 0
explosion.Parent = workspace
v:Destroy()
end
end)
end
end
for i,v in pairs(script.Parent.Engine:GetChildren()) do
if not v:IsA("Weld") then
v:Destroy()
end
end
wait(15)
script.Parent:Destroy()