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

.changed on boolvalue not triggering?

(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

2 comments

0

Do you mean you are manually changing the BoolValue in the explorer and not seeing "changed" in the output?

0

yes

1 answer

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.

2 comments

0

still doesn't work...

0

Bump

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