Thread: Fire rate
View Single Post
  #4  
Old 12-31-2005, 05:32 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Kronan
Here is a small example:


NPC Code:
//#CLIENTSIDE
function onCreated() {
this.fired = true;
}
function onWeaponFired() {
if (this.fired) {
// your stuff can go here
this.fired = false;
setTimer(5);
}
else
{
player.chat = "You must wait 5 seconds before firing again!";
}
}
function onTimeout() {
if (this.fired == false) {
this.fired = true;
}
}

Why did you make this.fired counterintuitive?
Reply With Quote