Does this work?
local Time = 0
Time.Changed:connect(function()
Print("Time Changed")
end
Does this work?
local Time = 0
Time.Changed:connect(function()
Print("Time Changed")
end
No, you can not use a Changed listening event on variables inside your script, unlike userdata. The reason for this is because roblox figures if you ever change a value and want something to happen with that change, you will make a function to be called for it. For example:
local Time = 0
function ChangeTime(val)
Time = val
print("Time Changed")
end
so instead of saying Time = whatever value, you say ChangeTime(whatever value)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Problem Is, I have a coroutine event that will fire when The Game Has Started. But The Game Has Started is a variable. how can I do this?
Use the same variable for the Game has started. You call the Game Has Started coroutine when you see the value change OR when you're about to change the value, and then have the coroutine have it do that for you + run the code.