playerValue.Value.Changed:Connect(function() print("----------------") end)
Very simple script I have a StringValue and whenever its changed I want it to do the function. Instead I get this error and I'm not sure why.
attempt to index nil with 'Connect'
You're trying to reference an RBXScriptSignal that is custom to the Value property I assume. This does not exist. You can only attached a Changed
signal family to an Instance. I suggest using the :GetPropertySignal()
twin as it allows us to do exactly what you wish to, hone into the Value property changing. This method allows us to supply an argument of which property we wish to listen to:
playerValue:GetPropertyChangedSignal("Value"):Connect(function() print("----------------") end)
If this works for you, don't forget to accept this answer