ID:268151
 
Take a look at this code:

mob
proc
Summon_coins_Check()
var/x = rand(1,15)
var/y = rand(1,11)
if(src.secret_coins == 7)
src <<"You have collected all the coins!"
src <<"You now get a wish!"
var/wish = input("What would you like to wish for?")in list("hp Boost","Get Rich in money")//yes, not alot of verbs
switch(wish)
if("hp boost")
var/random = rand(4000,10000)
src.maxhp+= random
src <<"You gained [random] hp!"
src.hp = src.maxhp
src.coins= 0
new/obj/coin1(x,y)
new/obj/coin2(x,y)
new/obj/coin3(x,y)

new/obj/coin4(x,y)
new/obj/coin5(x,y)
new/obj/coin6(x,y)
new/obj/coin7(x,y)
if("Get Rich in Money")
src.zenni += 100000
src.coins = 0
new/obj/coin1(x,y)
new/obj/coin2(x,y)
new/obj/coin3(x,y)
new/obj/coin4(x,y)
new/obj/coin5(x,y)
new/obj/coin6(x,y)
new/obj/coin7(x,y)
src <<"You are now rich!"
else
return


The problem is when I make the wish, the coins still stay in the inventory and don't randomize around the world.

Non-PC
        sleep(10000)
var/x = rand(1,150)
var/y = rand(1,150)
src.loc = locate(x,y,1)
In response to XzDoG
XzDoG wrote:
        sleep(10000)
> var/x = rand(1,150)
> var/y = rand(1,150)
> src.loc = locate(x,y,1)


src is the player in my proc. I heard usr is not good in procs, that's why if you look above, I use the objects name.

Non-PC
In response to Non-PC
Nevermind, figured out.

Non-PC