Posted: Fri Oct 12, 2018 11:32 am Post subject: Speedhack toggle
Hello im fairly new to lua however I do know a fair amount of c#. I would like to create a lua script inside of cheat engine that when a specific key is pressed the speedhack will set to a certain amount then either when the same key is pressed again or a separate key is pressed the speedhack will revert back to 1 as i understand the current hotkey for speedhack is not working correctly.
Thank you! _________________
You should work carefully with this script code!
If you make a mistake, cancel the 'Print Script',
close form, open again.
Code:
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
function killmytimer()
if mytimer then
mytimer.Destroy()
mytimer = nil
end
end
myhotkey = createHotkey(function()
if mytimer then
killmytimer()
speedhack_setSpeed'1'
else
mytimer=createTimer()
mytimer.interval=1
mytimer.OnTimer=function()
speedhack_setSpeed'0'
end
end
end, VK_F8)
or 2 Use with button: (You do not spend time with Timer)
Code:
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
myhotkey = createHotkey(function()
if myhotkey then
speedhack_setSpeed'0' -- or 10 etc
end
end, VK_F8) --F8 Speed 0
myhotkey = createHotkey(function()
if myhotkey then
speedhack_setSpeed'1'
end
end, VK_F9) -- F9 Speed Normal
or speed, give manually select and command
Code:
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
myhotkey = createHotkey(function()
if myhotkey then
speedhack_setSpeed(UDF1.CEEdit1.Text) --You should put a CEEdit on the table
end
end, VK_F8)
myhotkey = createHotkey(function()
if myhotkey then
speedhack_setSpeed'1'
end
end, VK_F9)
speedhack_setSpeed(UDF1.CEEdit1.Text) --You should put a CEEdit on the table
should be :
Code:
speedhack_setSpeed(tonumber((UDF1.CEEdit1.Text)) --You should put a CEEdit on the table
CEEdit is a TEXT must convert to number. Also if use CEEdit for speed hack amount, then considering avoid user to input 'non number' characters. _________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum