Go Back   GTAGaming Forums > Grand Theft Auto Mods > Grand Theft Auto IV Mods
Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-07-2009   #1
OnyxCrowe21
Registered User
Newbie Member
 
Join Date: Jan 2009
Posts: 2
OnyxCrowe21 is on a distinguished roadOnyxCrowe21 is on a distinguished road
Exclamation How to change the "key" in lua scripts

Hey guys, I hope this thread is read. I'm an idiot when it comes to this modding stuff.

I have Notepad++ downloaded in order to read the .lua scripts I download for the Alice program.

I've been noticing that ALL the scripts being released have TAB as the activation key. Is there any way (which I'm sure this is) I can change what key is used to activate the script?

For example: I have currently been using the saveme.lua script. To save anywhere, I just have to hit TAB.

Recently I downloaded the Bullet-time script and the Clear Wanted Level script.
Both of these use TAB as their key.

Can someone tell me/walk me through how to change the activation key so I can be able to use all scripts?

Thanks a lot. Forgive my ignorance! lol

-OC
OnyxCrowe21 is offline   Reply With Quote
Old 01-07-2009   #2
rappo
Professional Dumbass
 
rappo's Avatar
 
Join Date: Aug 2003
Location: Los Angeles
Posts: 6,986
rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.
hey, don't worry about it - it's not ignorance, everybody's gotta learn somehow! I'll use the saveme.lua script as an example.. at the bottom of the file you'll see this line twice:
Code:
if (IsKeyPressed(9) == 1) then
this means "if the key pressed is TAB, then..." so basically 9 is the code for TAB. this value is called an ASCII decimal character code. each key on the keyboard has one. here's a huge table of ascii codes... the value you put in the LUA script is the one in the DEC column:





furthermore you can make the LUA code run on two keypresses by doing something like:
Code:
if(IsKeyPressed(9) == 1 && IsKeyPressed(32) == 1) then
in that example the code checks to see if both TAB and SPACE are being pressed
__________________
rappo is online now   Reply With Quote
Old 01-07-2009   #3
OnyxCrowe21
Registered User
Newbie Member
 
Join Date: Jan 2009
Posts: 2
OnyxCrowe21 is on a distinguished roadOnyxCrowe21 is on a distinguished road
DUDE!!! You da man. haha

Thank you so much for this. I'm just getting into .lua scripting and modding. So this helps a TON!

Thanks, and probably look for more Q's in the future!

Peace!

-OC
OnyxCrowe21 is offline   Reply With Quote
Old 04-29-2009   #4
lilmcnessy
Registered User
Newbie Member
 
Join Date: Feb 2009
Posts: 3
lilmcnessy is an unknown quantity at this point
why is it some keys cant be used?
lilmcnessy is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:04 AM.