local NumberValue = Instance.new("NumberValue")
NumberValue.Parent = game.Workspace
NumberValue:GetPropertyChangedSignal("Value"):Connect(function(Value : number)
if Value == 5 then
---Do something cool
end
end)
GetPropertyChangedSignal doesn’t pass any values to connected callback functions.
local NumberValue = Instance.new("NumberValue")
NumberValue.Parent = game.Workspace
NumberValue.Changed:Connect(function(Number)
if Number == 5 then
--Do code.
end
end)
As recommended here, Changed should be used instead.
Ahh, yes, ofc, simple mistake. Remembering each method is hard when you have to know so many with so many languages. I appreciate you for pointing that out.