Page 1 of 1

Speed hack Script in Lua

Posted: Sat Jun 18, 2022 2:33 pm
by Balano
Guys, I'm setting up a Script and I would like more than one key to be done, but with separate speeds, for example, when I press Space it triggers a speed, and when I set another key it changes to another speed, I need to put it in the trainer


lastSpeed=1;

function checkKeys(timer)
if (isKeyPressed(VK_SPACE)) then
if lastspeed ~= 2.0 then
speedhack_setSpeed(2.0)
lastSpeed=2.0
end
else
if lastspeed ~= 1 then
speedhack_setSpeed(1)
lastSpeed=1
end
end

end

t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true)

Re: Speed hack Script in Lua

Posted: Thu Jun 23, 2022 8:19 pm
by SarashJessicaParker
You mean something like this?

Code: Select all

{$lua}

[ENABLE]
p_cheats = createTimer()
p_cheats.setInterval(1)
p_cheats.onTimer = function()

if isKeyPressed(VK_V) then
speedhack_setSpeed(25)
end
if isKeyPressed(VK_B) then
speedhack_setSpeed(1)
end
end


[DISABLE]
p_cheats.destroy()