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

how do I check if a boolean value has been changed?

Asked by 4 years ago

is there any other way to check if a boolean value has been changed?

i am getting the error PlayerGui.PlayerScripts.beam:51: attempt to index boolean with'Changed'

Doorr.Value.Changed:connect(function()
    print("changed")
end)
0
just detect if its false or not Tan0ak 28 — 4y
0
Doorr.Changed:connect. I think you dont need to type "Value" in there vovik 9 — 4y

2 answers

Log in to vote
0
Answered by
Pupppy44 671 Moderation Voter
4 years ago

You're not supposed to put the Value there.

Doorr.Changed:connect(function()
    print("changed")
end)

Hope this helps!

0
That is correct, however, is will fire whenever anything about the Instance changes (such as the name, or any other property). Mroczusek 111 — 4y
Ad
Log in to vote
0
Answered by
Mroczusek 111
4 years ago

Hey, though the answer above is correct, I strongly emphasize on using ':GetPropertyChangedSignal()'

I'll demonstrate how to use that event.

Doorr:GetPropertyChangedSignal("Value"):Connect(function()
    print("changed")
end)

Answer this question