Hello. Just to get this off first, I don't really have any experience scripting in .lua. So, there's probably a lot wrong with this script. What I'm trying to do is get it so when the on button is touched, it inserts smoke and fire into the bricks listed. Right now it doesn't do that.
Model layout: http://prntscr.com/bc9zbc
Code:
local b = script.Parent.Parent.FireB
local c = script.Parent.Parent.FireC
local d = script.Parent.Parent.FireD
local e = script.Parent.Parent.FireE
local f = script.Parent.Parent.FireF
local g = script.Parent.Parent.FireG
local h = script.Parent.Parent.FireH
local fir = Instance.new("Fire",b,c,d,e,f,g)
local smo = Instance.new("Smoke",b,c,d,e,f,g)
function onClicked()
print "Fire on"
fir = Instance.new("Fire",b,c,d,e,f,g)
smo = Instance.new("Smoke",b,c,d,e,f,g)
script.Parent.Parent.b.Fire.Size = 25
script.Parent.Parent.b.Smoke.Size = 20
script.Parent.Parent.b.Smoke.Color = "Black"
script.Parent.Parent.b.Smoke.RiseVelocity = 3
script.Parent.Parent.c.Fire.Size = 25
script.Parent.Parent.c.Smoke.Color = "Black"
script.Parent.Parent.c.Smoke.Size = 20
script.Parent.Parent.c.Smoke.RiseVelocity = 3
script.Parent.Parent.d.Fire.Size = 25
script.Parent.Parent.d.Smoke.Color = "Black"
script.Parent.Parent.d.Smoke.Size = 20
script.Parent.Parent.d.Smoke.RiseVelocity = 3
script.Parent.Parent.e.Fire.Size = 25
script.Parent.Parent.e.Smoke.Color = "Black"
script.Parent.Parent.e.Smoke.Size = 20
script.Parent.Parent.e.Smoke.RiseVelocity = 3
script.Parent.Parent.f.Fire.Size = 25
script.Parent.Parent.f.Smoke.Color = "Black"
script.Parent.Parent.f.Smoke.Size = 20
script.Parent.Parent.f.Smoke.RiseVelocity = 3
script.Parent.Parent.g.Fire.Size = 25
script.Parent.Parent.g.Smoke.Color = "Black"
script.Parent.Parent.g.Smoke.Size = 20
script.Parent.Parent.g.Smoke.RiseVelocity = 3
script.Parent.Parent.h.Fire.Size = 25
script.Parent.Parent.h.Smoke.Color = "Black"
script.Parent.Parent.h.Smoke.Size = 20
script.Parent.Parent.h.Smoke.RiseVelocity = 3
end
script.Parent.Touched:connect(onClicked)

4 comments
On a side note it doesn't make much sense to name the function for a touched event OnClicked
Just one quick side thing, this works and thank you so much! But for the off button, what would the code look like to remove the smoke and fire? Thanks!
local PartsToExtinguish = {--PartsHere} for _,v in pairs(PartsToExtinguish) do if v:FindFirstChild("Fire") then v.Fire:Destroy() end if v:FindFirstChild("Smoke") then v.Smoke:Destroy() end end --This is a little inefficient, but I'm not willing to provide a completely efficient script unless I see attempt at revision.
Got the off script to work! Thanks so much!