I am trying to make an explosion script that basically when a model blows up, leads to a explosion; not like the regular(Explosions from the instance). I am basically trying to make for say a transparent sphere after the explosion. Is there anyway I can get some tips on making this, it's incredibly confusing. Thanks.
✓ ANSWER ACCEPTED
Tired of the Instance.new Explosion, please help?
1 answer
✓ Accepted answer
function Explode(position, growsize, color, parent, speed, startsize)
coroutine.resume(coroutine.create(function()
p = Instance.new("Part", parent)
p.Anchored = true
p.BrickColor = BrickColor.new(color)
p.CFrame = CFrame.new(position)
p.Shape = 0
p.FormFactor = 3
p.Size = Vector3.new(startsize.X, startsize.Y, startsize.Z)
for i=1, growsize * 4 do
wait(speed / (growsize * 4))
p.Size = p.Size + Vector3.new(0.25, 0.25, 0.25)
end
p:Remove()
end))
end
Position is the Vector3 position of where you want it to be, growsize is the integer value of what you want it to grow to, color is the string value color, parent is obviously where you want it parented, speed is in seconds how long it takes to grow, and startsize is the Vector3 value of the size it starts as.
Call like so:
Explode(Vector3.new(0, 0, 0), 30, "Really red", game.Workspace, 4, Vector3.new(1, 1, 1))
1 comment
0
Thanks for that I kind of understand now.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Not sure exactly what you mean... You want like an expanding yellow sphere that looks like an explosion? So like a function that creates a explosion look-a-like part?
Like the second image of this place? : http://www.roblox.com/Epic-Destroy-the-Noob-V-3-3-place?id=37599642
Yeah man that's exactly what it is. It's been giving me trouble since I'm new to LUA.