Obviously this script is supposed to toggle a fireplace on or off, but it doesn't do, well, anything. It doesn't even give me any errors. My hierarchy is correct--I checked 4 times and rewrote it once too, just to make sure.
local fireplaceon = false
func = function( p ) -- functions go HERE
print(p.Name .. " toggled the fireplace!")
if fireplaceon == false then
fireplaceon = true
game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Fire.ParticleEmitter.Enabled = true
game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Fire.SpotLight.Enabled = true
for i, v in pairs(game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Chimney:GetChildren()) do
if v.Name == "Smoke" then
v.ParticleEmitter.Rate = 20
end
end
end
if fireplaceon == true then
fireplaceon = false
game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Fire.ParticleEmitter.Enabled = false
game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Fire.SpotLight.Enabled = false
for i, v in pairs(game.Workspace.FaradayHouse.LivingRoom.GasFireplace.Chimney:GetChildren()) do
if v.Name == "Smoke" then
v.ParticleEmitter.Rate = 0
end
end
end
end
