So Im trying to make it so that when a variable changes
it fires something
for instance
Var = 0
--if it changes do something here
So Im trying to make it so that when a variable changes
it fires something
for instance
Var = 0
--if it changes do something here
For Values
script.Parent.Value.Changed:Connect(function(changed)
--Do whatever
end)
or
For Variables
while true do
wait()
if variable == true then
--Do whatever
return
end
end
With physical values, do this:
local Value = script.Parent
Value.Changed:Connect(function()
--Thing here
end
You could use a print statement and the GetPropertyChangedSignal event.
um he meant for variables not instances
Well. The guy did say for instance in his post
with that 'for instance' he means 'for example'
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
i dont think there's a direct way but u can fire a different function every time it changes like Var = 1 function()
Please search before asking a question. https://scriptinghelpers.org/questions/31858/is-there-a-way-to-have-any-variable-have-a-changed-event
lul i know a slightly better way than a while loop