Thread: Dashing/Running
View Single Post
  #5  
Old 04-28-2009, 05:57 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
HTML Code:
function onKeyPressed() {
  for (temp.k = 0; temp.k < 4; temp.k++;) {
    if (!keydown(temp.k)) continue;

    this.("dash_" @ temp.k)++;
    if (this.("dash_" @ temp.k) => 2) {
      player.chat = "Doing Dash!" SPC this.("dash_" @ temp.k);
    }
      //Clear the attempt... this.("dash_" @ temp.k) = null;
    scheduleevent(0.1, "onResetDash", temp.k);
    break;
  }
}
Should work, but the onKeyPressed is being sent about 30 times during this procedure.... x-x
Reply With Quote