Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tired of the Instance.new Explosion, please help?

Asked by 10 years ago

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.

0
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? jav2612 180 — 10y
0
Like the second image of this place? : http://www.roblox.com/Epic-Destroy-the-Noob-V-3-3-place?id=37599642 jav2612 180 — 10y
0
Yeah man that's exactly what it is. It's been giving me trouble since I'm new to LUA. TrunksTakaski 20 — 10y

1 answer

Log in to vote
1
Answered by
jav2612 180
10 years ago

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))

0
Thanks for that I kind of understand now. TrunksTakaski 20 — 10y
Ad

Answer this question