Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can someone help with a BoolValue based script?

So recently I have been editing the Norfolk FireSystem, and im trying to make my "Particle" smoke emitters enable as soon as the fireactive boolean is true. This is what I mean:

https://youtu.be/s919JVExrn8 (VIDEO IS FOR REPRESENTATION USE ONLY)

Scripts If you Did Not See It (Only Attempt One Is In The Video, However All Failed)

ATTEMPT ONE: (DID NOT WORK)

SmokeA = script.Parent.SmokeA.Smoke1.Particle.Enabled
RES = script.Parent.Parent.RES.FireActive
while RES.Value == true do
SmokeA = true
end

ATTEMPT TWO: (DID NOT WORK)

SmokeA = script.Parent.SmokeA.Smoke1.Particle.Enabled
RES = script.Parent.Parent.RES.FireActive

if RES.Value = true then
SmokeA = true
end

FINAL ATTEMPT THREE: DID NOT WORK

SmokeA = script.Parent.SmokeA.Smoke1.Particle
RES = script.Parent.Parent.RES.FireActive

while RES.Value == true do
SmokeA.Enabled = true

end

This will be a huge help to a future project im making. Thanks for helping,

ChiefNight

1 comment

0

The last one would work if you used an if statement, like in the previous ones, but for some reason you decided to make a loop that will most likely crash your game.

2 answers

if RES.Value == true or if RES.Value = true?

Explanation: You don't need == true to check if it's true, just use if RES.Value then

Final result:

local SmokeA = script.Parent.SmokeA.Smoke1.Particle
local RES = script.Parent.Parent.RES.FireActive

if RES.Value then 
SmokeA.Enabled = true
end

3 comments

0

That unfortunately didn't work :/

0

Is there another way I should be able to do this, like maybe moving the place of the script?

0

I see the problem, let me edit the answer.

1local SmokeA = script.Parent.SmokeA.Smoke1.Particle.Enabled

local RES = script.Parent.Parent.RES.FireActive

While True Do

wait()

if RES.Value == true then

        SmokeA = true

        else

        SmokeA = false

  end

end

3 comments

0

I hope this will help, Also Just joined so sry if I wront anything wrong

0

Ok

0

Doesnt work. :/

This discussion is preserved as it was. New answers, comments, and votes are closed.