• Timers not executing right?
    1 replies, posted
So here is the code to the timers --Place Holder | Draw the menu from the right timer.Create("DrawOut", .1, 5, function() PanelPosition = PanelPosition-(width/5) print("out: "..PanelPosition) end) --Place Holder | Draw back on timer timer.Adjust("DrawIn", .1, 5, function() PanelPosition = PanelPosition+(width/5) print("in: "..PanelPosition) end) timer.Simple(6, timer.Start("DrawIn")) Now, the first timer should run first, the 2nd should run 6 seconds after started by the timer.Simple But t hey are running simultaniously: in: 1981.8 out: 1920 in: 1981.8 out: 1920 in: 1981.8 out: 1920 in: 1981.8 out: 1920 in: 1981.8 out: 1920 Which means they are negating eachother :S Can anyone see anything i have done wrong? I rarely work with timers so it is most likely something retardedly simple...
Rather than using timer.Adjust, why not just do [lua]timer.Simple(6,function() timer.Create("DrawIn", .1, 5, function() PanelPosition = PanelPosition+(width/5) print("in: "..PanelPosition) end); end); [/lua]
Sorry, you need to Log In to post a reply to this thread.