View previous topic :: View next topic |
Author |
Message |
Lorizzuoso Cheater Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 11, 2022 1:33 pm Post subject: Lua timer |
|
|
Hi,i created two scripts for two addresses that keep adding a value every tick and they work but the problem is that when i try to enable them both their values will keep going up without stopping,even if i disable them.
This only happens when i activate them both.
This is the code(is the same for both addresses):
[ENABLE]
{$lua}
timer1 = createTimer(nil, false)
timer1.Interval = 2
timer1.Enabled = true
timer1.OnTimer = function(timer)
writeFloat(0x209EC20C,readFloat(0x209EC20C)+0.6)
end
{$asm}
[DISABLE]
{$lua}
timer1.Enabled = false
writeFloat(0x209EC20C,0)
{$asm}
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1251
|
Posted: Mon Apr 11, 2022 1:44 pm Post subject: |
|
|
Make sure you don't name the scripts the same timer.
Code: | [ENABLE]
{$lua}
timer1 = createTimer(nil, false)
timer1.Interval = 2
timer1.Enabled = true
timer1.OnTimer = function(timer)
writeFloat(0x209EC20C,readFloat(0x209EC20C)+0.6)
end
{$asm}
[DISABLE]
{$lua}
if timer1 then timer1.Destroy() timer1=nil end
writeFloat(0x209EC20C,0) |
_________________
|
|
Back to top |
|
|
Lorizzuoso Cheater Reputation: 0
Joined: 09 Apr 2022 Posts: 27
|
Posted: Mon Apr 11, 2022 2:00 pm Post subject: Lua timer |
|
|
Thanks man,it works now!Btw nice pfp
|
|
Back to top |
|
|
|