Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need some help (speedhack lua)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
TheInsaneHacker
How do I cheat?
Reputation: 0

Joined: 27 Sep 2019
Posts: 1

PostPosted: Fri Sep 27, 2019 11:24 am    Post subject: Need some help (speedhack lua) Reply with quote

Hi,

I've just made a speedhack script in lua, but it doesn't work for some reason.
When I execute it, there is no script error, but when I press on my "S" key the speed doesn't change.
I have also tried to change the 0x53 to VK_ESCAPE or something, but that didn't work either.
I was wondering if someone can help me out Smile.

This is my script in lua:

lastspeed = 1

if (isKeyPressed(0x53)) then
if lastspeed == 1 then
speedhack_setSpeed(0.5)
lastspeed = 0.5
end
else
if lastspeed == 0.5 then
speedhack_setSpeed(1)
lastspeed = 1
end
end
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Fri Sep 27, 2019 12:03 pm    Post subject: Reply with quote

you need an infinite loop, a timer, or an actual hotkey so it doesn't run just once. I just got in from exercising so don't really feel like typing code off the top of my head but there are various examples on the forum you should be able to find by searching for speedhack_setSpeed along with createTimer or createHotkey
_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3325

PostPosted: Fri Sep 27, 2019 1:27 pm    Post subject: Re: Need some help (speedhack lua) Reply with quote

TheInsaneHacker wrote:
Hi,

I've just made a speedhack script in lua, but it doesn't work for some reason.
When I execute it, there is no script error, but when I press on my "S" key the speed doesn't change.
I have also tried to change the 0x53 to VK_ESCAPE or something, but that didn't work either.
I was wondering if someone can help me out Smile.

This is my script in lua:

lastspeed = 1

if (isKeyPressed(0x53)) then
if lastspeed == 1 then
speedhack_setSpeed(0.5)
lastspeed = 0.5
end
else
if lastspeed == 0.5 then
speedhack_setSpeed(1)
lastspeed = 1
end
end

You know, you could just set up hotkeys in CE for exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites