View Single Post
  #29  
Old 12-14-2008, 03:39 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Pelikano View Post
Why "this.ower"?
You can name it whatever you want, I chose owner to represent it's the person who spawned it.

Quote:
Originally Posted by Pelikano View Post
"temp.proj.owner = player;"
As I said, you can't access "player" in a serversided onCreated(), since it's not an event related to a player but rather when the script is executed the first time.

Quote:
Originally Posted by Pelikano View Post
Why "NULL"?!
NULL and "" is the same thing, more or less. In this case it doesn't matter which you use.

Quote:
Originally Posted by Pelikano View Post
Wtf?! temp.proj.join("bullet");
Yes, let me explain:

temp.npc = putnpc(x, y, ""); - This spawns an NPC on the coordinates x and y. By doing it like this you can change the values of the spawned NPC by accessing "temp.npc".

npc.owner = player - This sets the this.owner in the projectile to the player object, so you can access data from the player who spawned the projectile.

npc.join("bullet"); - This joins the newly spawned NPC to your projectile class.


Just try the code I gave you man, it'll work.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote