Eroz
1
hi. i’m trying to script a weapon. i want it to be executed when player is Pressing T.
i got this:
if (keydown(T)) {
MY SCRIPT }
any error?[COLOR=“Silver”]
---------- Post added at 10:54 PM ---------- Previous post was at 10:33 PM ----------
[/COLOR]…[COLOR=“Silver”]
---------- Post added at 11:14 PM ---------- Previous post was at 10:54 PM ----------
[/COLOR]i’ve been trying different things, but no result
[QUOTE=Eroz;96214]
hi. i’m trying to script a weapon. i want it to be executed when player is Pressing T.
i got this:
if (keydown(T)) {
MY SCRIPT }
any error?[COLOR=“Silver”]
---------- Post added at 10:54 PM ---------- Previous post was at 10:33 PM ----------
[/COLOR]…[COLOR=“Silver”]
---------- Post added at 11:14 PM ---------- Previous post was at 10:54 PM ----------
[/COLOR]i’ve been trying different things, but no result
[/QUOTE]
Keydown is used for the mapped key bindings. Since t doesn’t belong to anything by default you should therefore use keydown2(index,boolean)
So therefore your code should be:
if (keypressed && keydown2(keycode(t),true)){
//your code
}
You need to make sure you include keypressed otherwise the script wont be checking for the condition unless it’s in some kind of loop.
Eroz
4
Thank you very much, Spooon. and Tricxta…