Thread: keydown()
View Single Post
  #18  
Old 11-24-2002, 02:11 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by emortylone
.05 may have it repeat at times, but then again when you do a GUI or something, .1 may be not sensitive enough, people often just tap and release. I'd say set a variable.
NPC Code:

if (created)
{ this.tap=0; timeout=.05;}
if (timeout)
{ if (keydown(0) && this.tap==0)
{ action(); this.tap=1;}
if (!keydown(0) && this.tap==1)
{ this.tap=0;}
timeout=.05;
}


That may be the best way.
---Shifter
that could be a good way if your script wasn't inefficent
Reply With Quote