obj
locker
icon = 'locker.dmi'
var/obj/locker = l
var
phaser = 10
communicator = 10
verb/Get_Phaser()
if(l.phaser >=1)
new /obj/phaser (usr)
could someone please take a look at this and tell me why it doesnt work. im trying to have the get phaser verb add a phaser to the usr inventory
ID:177172
![]() Oct 20 2002, 7:57 pm
|
|
Garthor wrote:
Well... Then the real question will be how to define it. |
Treasurecat wrote:
Then the real question will be how to define it. Or not. You don't NEED to define it, because you don't need to use it. Forget l, use src like Garthor said. <code>obj locker icon = 'locker.dmi' var phaser = 10 communicator = 10 verb/Get_Phaser() if(src.phaser > 0) new /obj/phaser(usr) //Make a phaser in the usr's inventory src.phaser-- //Decrement number of phasers </code> That should work. |
Hehe, yep. Slipped my mind for a second. :)
Isn't it strange that whenever one of us helps someone in Newbie Central, the other almost always has something to add or correct? We're like a newbie helping team. :P |
l isn't defined, so l.phaser won't do anything. I assume you mean src.phaser, an in, the phaser var for the locker. In which case, it's still redundant, since you're not decrementing the phaser var.
ver/verb/Get_Phaser() doesn't work. Everything below and including verb/Get_Phaser() needs to be unindented one.
You need a "set src in oview(1)" at the start of the verb, so that you can use it without having it in your contents.