ID:262514
 
Code:
obj/dragonballs/earth7
icon = 'dragonball.dmi'
icon_state = "7"
verb
Get()
set category = "Inventory"
set src in oview(0)
Move(usr)
if (usr.gotdb7==1)
usr<< "You have this one already"
return
if (usr.gotdb7==0)
set src in oview(0)
usr.gotdb7=1
checkdbz()
src.loc = locate(0,0,0)
sleep(3000)
var/x = rand(1,150)
var/y = rand(1,150)
src.loc = locate(x,y,1)


Problem description:Ok, the problem is when i have the dragonball aldeay it picks it up anyway,
LET ME MAKE MY SELF CLAERER, I CAN PICK UP MORE THAN ONE DRAGONBALLS, can someone please help me

Yes we can help you - DON'T RIP OTHER PEOPLE'S CODING, ESPECIALLY ZETA.
obj/dragonballs/earth7
icon = 'dragonball.dmi'
icon_state = "7"
verb
Get()
set category = "Inventory"
set src in oview(0)
if (usr.gotdb7==1)
usr<< "You have this one already"
return
if (usr.gotdb7==0)
Move(usr)
usr.gotdb7=1
checkdbz()


if you do the src.loc thingy.. doesnt it move out of your invent? and please dont rip Zeta, nobody plays Zeta Rips these days, and i mean no one, all of them are the same, seen 1, and u have had enough
When Move(usr) is before your "has_item" checks, you get the item before you see if the player is allowed to pick it up. And if your line is "if(usr.gotdb7==1)" it is the same as "if(usr.gotdb7)" because the statement after IF is checked to see if it is true or false. 1 is true, so it will return fine without ==1 in it. if(usr.gotdb7) and
if(!usr.gotdb7) are the same as your two statements, and take a few keys less to code without reducing readability.

Remove ==1 from your statements, and relocate Move(usr) to be in your code that executes below if(usr.gotdb7==1).
In response to Steelhouse
or you could use else.
In response to Steelhouse
dont you mean usr.gotball7 == 0 >.>