ID:144859
 
I was wondering why this doesn't work:
Code:
obj
Katana
icon='weapons.dmi'
icon_state="Katana1"
got=0
Click()
if(src in oview(1))
if(!src.got)
Move(usr)
src.got=1
usr<<"You pickup the Katana."
else
usr<<"You equip the Katana."

Problem description:
When I click it, it moves into my inventory and says you picked up the katana. When I click it again nothing happens. Any Ideas?
just put if(src.got = 1) for the else.
Ditch the got var.

obj
Katana
icon='weapons.dmi'
icon_state="Katana1"
Click()
if(src in usr.contents)
usr<<"You equip the Katana."
else if(src in oview(1))
Move(usr)
usr<<"You pickup the Katana."
else ..()
In response to Evidence
Thanks I got it working much appriciated!
In response to WarLin
WarLin wrote:
just put if(src.got = 1) for the else.


Thats bad syntax. ;)