PcoWSkbVqDnWTu_dm2ix
The information on this page may no longer be accurate. To see the latest, go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar

Enabled

Fire

bool

The Enabled property, much like ParticleEmitter/Enabled, determines whether flame particles are emit. Any particles already emit will continue to render until their lifetime expires. This property is useful for keeping pre-made fire effects off until they are needed later. Since flame particles are destroyed when the Fire object’s Instance/Parent is set to nil, this property is useful in allowing existing particles the opportunity to expire before destroying the Fire object altogether. See the function below.

local Debris = game:GetService("Debris")
local part = script.Parent
function douseFlames(fire)
	fire.Enabled = false -- No more new particles
	Debris:AddItem(fire, 2) -- Remove the object after a delay (after existing particles have expired)
end
douseFlames(part.Fire)


Code Samples


Toggle Fire Effect

This code sample allows a player to click the parent BasePart to toggle a fire effect.