if player is pressing "T"

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


---------- Post added at 11:14 PM ---------- Previous post was at 10:54 PM ----------

[/COLOR]i’ve been trying different things, but no result

Use keydown2

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.

Thank you very much, Spooon. and Tricxta…