idk lua im trying to make speedhack toggleable with the e key and made this but it fail
if (isKeyPressed(VK_E)) then cycle()
end
function cycle()
if toggle ~= 0 then speedhack_setSpeed(0.25)
toggle = 1
else speedhack_setSpeed(1)
toggle = 0
end
end
Edit: im requesting someone to fix it so it operates as I intend
[RESOLVED] lua speedhack toggle
-
- What is cheating?
- Posts: 2
- Joined: Sat Oct 15, 2022 5:23 pm
- Reputation: 0
[RESOLVED] lua speedhack toggle
Last edited by isuckatall on Tue Oct 18, 2022 6:40 am, edited 2 times in total.
Re: lua speedhack toggle
Please don’t use clickbaity titles. I have edited it out.
-
- What is cheating?
- Posts: 2
- Joined: Sat Oct 15, 2022 5:23 pm
- Reputation: 0
Re: lua speedhack toggle
ok sorry Casanova
Re: lua speedhack toggle
This will work as intended:
More VK_Key codes available [Link]
Code: Select all
if tmr then tmr.destroy(); tmr = nil end
function ToggleSpeedHack(key, speed)
if key == nil then key = 0x1B end -- Escape key is default if not defined
function setSpeed(speed)
if speed == nil then speed = 1 end
speedhack_setSpeed(speed)
end
tmr = createTimer(getMainForm())
tmr.Interval = 20
tmr.OnTimer = function()
if isKeyPressed(key) then
setSpeed(speed)
else
setSpeed(1)
end
end
end
-- 0x45 = VK_E
ToggleSpeedHack(0x45, 3)
Who is online
Users browsing this forum: No registered users