Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Made a code that enable a fire but i want to disble it again but how?

Asked by 5 years ago

i made a script in Roblox Studio that enables fire but i need help to disable the fire

here's the code :

script.Parent.ClickDetector.MouseClick:Connect(function(plr) game.Workspace.Part.Fire.Enabled = true end)

btw in a ClickDetector

0
:Disconnect() or a debounce would help you. User#25115 0 — 5y

1 answer

Log in to vote
1
Answered by
HaveASip 494 Moderation Voter
5 years ago
Edited 5 years ago

It is very easy to make! All you have to do that use debounce.

Here is your script

local debounce = false

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
    if debounce == false then
        debounce = true
        workspace.Part.Fire.Enabled = true
    else
        debounce = false
        workspace.Part.Fire.Enabled = false
    end
end)

You can read more here

0
Thank you so much :D Freddan2006YT 88 — 5y
Ad

Answer this question