Hello.
Some of you may or may not have seen my game War on the Sea
I have added treasure party bombs, which are operational but laggy.
I think it has something to do with the amount of coins and gems I generate.
I tried using wait() and it worked, but it just doesn’t look good.
I am searchign for a solution that is non laggy but sends the astatine and coins into existence quickly.
Problamatic function:
function blowUp()
task.wait(5)
for count = 1,3 do
local d = diamond:Clone()
d.Position = script.Parent.Position
d.Parent = workspace
end
for count = 1,15 do
local g = gold:Clone()
g.Position = script.Parent.Position
g.Parent = workspace
end
for count = 1,10 do
local g = silver:Clone()
g.Position = script.Parent.Position
g.Parent = workspace
end
local flame = game:GetService("ReplicatedStorage").Flames:Clone()
flame.Parent = script.Parent
explosion = Instance.new("Explosion")
explosion.BlastRadius = 1
explosion.BlastPressure = 300000 -- these are really wussy units
explosion.DestroyJointRadiusPercent = 0
explosion.Visible = false
flame:Emit(50)
explosion.Position = script.Parent.Position
explosion.Parent = game.Workspace
script.Parent.Transparency = 1
end