So Basically, I'm trying to make a function that plays a call back whenever a var changes
So I got some code from another Question
function Changed()
local last = varYouWantedToTrack;
while true do
wait()
if varYouWantedToTrack ~= last then
-- It changed. How nice.
end
last = varYouWantedToTrack;
end
end
and I want to change the "varYouWantedToTrack" part to a pram (and also add a call back to)
function changed(var --[[This soposed to be able to access this var, and want it to update even when I changes]], Callback )
local last = var;
while true do
wait()
if var ~= last then
-- It changed. How nice.
-- How do u make a Callback?
end
last = var;
end
So how do I change or access a passed, Global (to the script) var and use it as a local (to function) var and it to change as the originally passed var changes?
If you read all of that you are pogers :P
So Please Help me if you can.
P.S: @AntoninFearless is Helping me so it might be answered soon
P.P.S. Also, How do you make callback funcs
