I have a script that I'm using to make a working fireplace switch and it's almost complete with working switches. The only thing wrong with it is that clicking the first switch disables the particle emitters and clicking the second switch won't turn them back on but it still goes transparent like it should. I want to know what to add or change to the script below(I also added this same script to the second switch, but the values are reversed):
local switch
function onClick(playerWhoClicked)
switch = false
if switch == false then
script.Parent.Parent.FSwitchA.Transparency = 0
script.Parent.Parent.FSwitchB.Transparency = 1
script.Parent.Parent.Fire1.Firenum1.Enabled = false
script.Parent.Parent.Fire2.Firenum2.Enabled = false
script.Parent.Parent.Fire3.Firenum3.Enabled = false
script.Parent.Parent.FireSmoke.ChimneySmoke.Enabled = false
else
switch = true
if switch == true then
script.Parent.Parent.FSwitchA.Transparency = 1
script.Parent.Parent.FSwitchB.Transparency = 0
script.Parent.Parent.Fire1.Firenum1.Enabled = true
script.Parent.Parent.Fire2.Firenum2.Enabled = true
script.Parent.Parent.Fire3.Firenum3.Enabled = true
script.Parent.Parent.FireSmoke.ChimneySmoke.Enabled = true
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClick)

1 comment
Thanks I got it to work just fine.