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

.Changed or :GetPropertyChangedSignal("Value") not working?

So I have a script in workspace, with a value in that script.

local value = script.Value

value.Value = true
value.Value = false

value:GetPropertyChangedSignal("Value"):Connect(function()
	if inGame.Value == false then
	--rest of script
	end
end)

However, the problem is the script never starts.

Is there any reason as to why?

2 comments

0

You should not be using GetPropertyChangedSignal for a value holder. Use the changed event instead.

0

ive tried changed, it didnt work tho

3 answers

try this, tell me what prints. also, are you sure ur changing the value?

local value = script.Value

value.Value = true
value.Value = false
--ingame was never declared, declare it.
value:GetPropertyChangedSignal("Value"):Connect(function()
warn("Value Changed")
    if inGame.Value == false then
    --rest of script
warn("false")
else 
print("true")
    end
end)

5 comments

0

manually change the bool value

0

oh and inGame was the value name, sorry about that.

0

Do not use GetPropertyChangedSignal for this -1

0

nothing is printing

0

Change the name of the bool, ur doing script.Value

ok so, you have to put the " = true, = false" AFTER the GetPropertyChanged

Also, script.Value is probably not a valid property of a script.. It isn't...

Try

script.Parent.Value 

Instead...., and I hope you're using a value based object like StringValue, IntValue, etc. On those objects, only the Value property can be used with GetPropertyChanged as detailed in the following link of the Roblox documentation.

https://developer.roblox.com/en-us/api-reference/function/Instance/GetPropertyChangedSignal

1 comment

0

and it assumed your script is a child of the object you're trying to get the "Value" property of. :D

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