I want to learn how I can have a function that activates when a value of a variable (In my case a string value in replicated storage) is changed.
What is the issue?
I could have a while loop that is only delayed with a wait() but that would cause unessary lag that I do not want.
What solutions have you tried so far?
I have tried looking on the developer hub, but don’t know what to even search for. I looked under events of values, and couldn’t find it. Wait…seems like something like what I’m asking should be in there I should probably look better next time.
4 All the code that I have now
local status = game:WaitForChild("ReplicatedStorage").statusText
status.Oneventchangelol:connect(function()
lol
end)
Changed detects whenever any property of the object is changed. GetPropertyChangedSignal only detects when one does.
local status = game:GetService("ReplicatedStorage"):WaitForChild("statusText")
status:GetPropertyChangedSignal("Value"):Connect(function()
print(status.Value)
end)