How can I turn on and off a campfire

Here is what I want to do when I click on the campfire fire appears and when I click it again the fire disappears I tried to use instances but I didn’t know what to do, What do I do?
(Hope this made sense)

Are you using Fire object, ParticleEmitter or what?
What you could do is add a ClickDetector and implement .MouseClick event - so once this event fires simply set Enabled property to either true or false.

1 Like

This can be done simply through using both ClickDetectors and the MouseClick event, as mentioned by @rokec123.

You would of course need to add both a fire instance and a ClickDetector to the object you wish to have fire.

Inside of a Script located inside that same Part/Model, you could implement the following code:

local ClickDetector = script.Parent:WaitForChild("ClickDetector")
local Fire = script.Parent:WaitForChild("Fire")

ClickDetector.MouseClick:Connect(function()
    Fire.Enabled = not Fire.Enabled
end)

The simple one liner Fire.Enabled = not Fire.Enabled just takes that property and applies the opposite boolean value to it. (True/False).

3 Likes