Speed hack Script in Lua

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
Balano
What is cheating?
What is cheating?
Posts: 1
Joined: Sat Jun 18, 2022 1:59 pm
Reputation: 0

Speed hack Script in Lua

Post 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)

SarashJessicaParker
Expert Cheater
Expert Cheater
Posts: 59
Joined: Sat Sep 21, 2019 4:21 pm
Reputation: 41

Re: Speed hack Script in Lua

Post 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()

Post Reply

Who is online

Users browsing this forum: No registered users