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

.changed on boolvalue not triggering?

Asked by 6 years ago
Edited 6 years ago

(bump) Hi everyone! First of all, thanks for taking your time to read this question. I'm making a script that triggers when the value from a boolvalue changed. This is my script:

print('starting')
script.Parent.Changed:connect(function()
    print('changed')
    script.Parent.Parent.Parent.Littletrigger.Value = true
    wait(0.1)
    script.Parent.Parent.Parent.Littletrigger.Value = false
end)

I do always see "starting" in the output but when i change the value, i never see "changed" in the output. Also, i'm not getting any errors.... The localscript is in the boolvalue itself. Why a local script? This is my explorer:

StarterGui ScreenGui AvailableRooms BoolValue LocalScript

Thanks in advance for your help!, Jonas

0
Do you mean you are manually changing the BoolValue in the explorer and not seeing "changed" in the output? vector3_zero 1056 — 6y
0
yes marketmanager1 52 — 6y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
6 years ago
Edited 6 years ago

I'd suggest using the new method of instances, Instance:GetPropertyChangedSignal(string Property)

This can be used to use a Changed event just for one property, and it's guaranteed to work 100% of the time.

script.Parent:GetPropertyChangedSignal("Value"):Connect(function()
    --code here
end)

Hope this helps, if you have any questions, feel free to comment.

0
still doesn't work... marketmanager1 52 — 6y
0
Bump marketmanager1 52 — 6y
Ad

Answer this question