View Single Post
  #1  
Old 12-03-2008, 04:38 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Custom Projectile

PHP Code:
function onPlayerChats() {
  if (
player.chat == ":destroy")
    
this.destroy();
}
//#CLIENTSIDE
function onCreated() {
  
setimg("era_pl9-bullet.png");
  
setshape(1,32,32);
  
setTimer(0.05);
  
this.owneraccount player.account;
  
this.dird player.dir;
  
this.spread random(-client.spread,client.spread);
  
scheduleevent(5,"Destroy","");
}
function 
onTimeOut() {
  
this.+= vecx(this.dird) + (player.dir in {02} ? this.spread/16 0);
  
this.+= vecy(this.dird) + (player.dir in {13} ? this.spread/16 0);
  
setTimer(0.05);

I am trying to make a custom projectile.
Well, it works fine unill now, the only part that is missing, is the damage part.

Well, I am stuck, how can I make it damage on Hit, without using shoot()?
Reply With Quote