Problem description:
I wanted to write some code that means when you bumb into a player (and only a player) one of their variables and not mine changes so the die, but I can't find a way for another player to change someone elses variable or for their to be a check on Bump() that checks if its another player
Feb 17 2014, 2:52 am
|
|
Let us see your code so we can get a grasp of what you understand at the moment and we will go from there.
|
Hello, Neatht.
Well, you might first want to check and make sure it's a mob because mobs have a variable called client. The mob's client variable is set for players (not NPCs), so checking if that variable is true a good way to know if it's a player or not. Something along the lines of... ... Be warned that in this example Obstacle is not typeset to mob, so you must use the : when addressing it's client variable AFTER determining if it is a mob. If you don't feel comfortable doing that, there are some other ways to accomplish this. ... or... ... *edit* Fixed mistake pointed out by Pirion. Sorry, I did some copying and pasting :P Also, this should go without saying, but this is not a complete "here-ya-go" code. |
If you are using inheritance, you can do as below:
Bump(atom/Obstacle) Koshigia: #3 doesn't define an M under bump. :) |
In response to Pirion
|
|
Thanks Pirion :)
|
In response to Koshigia
|
|
how would I change a variable on them so their variable deaths changes by +1
|