ID:263624
 
Code1:
    /Pokeball/verb/
Return_Pokemon(mob/player/Pokemon/M in view())
if(M.owner == "[usr]")
view() << "Return [M]"
M.loc=locate(3,3,3)
else
usr << "[M] is not your pokemon"
return


Code2:
obj
Pokeball
icon = 'Objects.dmi'
icon_state = "Pokeball"
value = 100
verb
Get()
set src in oview(1)
usr.contents+=new/obj/Pokeball
del(src)
verb
Drop()
src.Move(usr.loc)
verb
Throw_pokeball(var/mob/M)
set src in usr.contents
if(istype(usr,/mob/player/Trainer/))
if(istype(M,/mob/player/Pokemon))
if(!M.owner)
src.target = M
Move(usr.loc)
src.density = 1
walk_towards(src,M,6)
spawn(10)
if(prob(15))
world << "[usr] has caught [M]!"
M.owner = "[usr]"
M.Caught = 1
M.nickname = input(usr,"What would you like to name the newly captured [M]","nickname",M.nickname)
usr.verbs += new/Pokeball/verb/Return_Pokemon
if(M.nickname == "")
M.nickname = M.name
M.name = "[M.nickname]([M.owner])"
del(src)
else
view() << "[usr] fails to catch [M]"
del(src)
else
usr << "[M] is already caught"


Problem description:
whenever I try to return my pokemon it says im not its owner,then when I edit its var to see I click on the var owner and it says my name >> how do I fix it so the return works?

//"[usr] is wrong"
if(M.owner == "[usr]")

//== usr is correct
if(M.owner == usr)
lol whyd u reply when id already done this lol
In response to Rickoshay
the first time I tried usr but it didnt work so I changed it to [usr] and that didnt work either
In response to Element Hero creator
have u made so that when u create get the poke owner = usr if its a proc owner = src?

and try this

 Return_Pokemon(mob/player/Pokemon/M in view())
if(M.owner == usr
view() << "Return [M]"
M.loc=locate(3,3,3)
return //try this see what happens
In response to Rickoshay
Nope it didnt work