ID:146221
 
Code:
mob
proc
deldballs() //del the dball proc
for(var/obj/dragonballs/O in src.contents) //use the for proc to run thru all the dballs
if(O) //if there is any in the users contents
del(O) //del them
sleep(15)
world << "The dragonballs have returned to normal!"
New()
var/obj/dragonballs/Dragonball_1/a = new // What you want to locate in the map
a.loc = locate((rand(1,world.maxx)),(rand(1,world.maxy)),1) //Were its going


Problem description:
I want to make a new set of dragonballs after deleting them within the same proc. but I'm not sure if I'm doing this (since I get an error)

var/obj/T = locate((rand(1,world.maxx)),(rand(1,world.maxy)),1)
new/obj/DragonBall1 (T)
new/obj/DragonBall2(T)

just add more dragonballs
Code:
mob
proc
deldballs() //del the dball proc
for(var/obj/dragonballs/O in src.contents) //use the for proc to run thru all the dballs
if(O) //if there is any in the users contents
del(O) //del them
sleep(15)
world << "The dragonballs have returned to normal!"
new obj/dragonballs/Dragonball_1(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1)) //Were its going


The problem was the New() proc after sleep. (Also note how I changed the new part... for new it goes either these two ways:
var/___ = new(loc)
or: new /____(loc)


If you have 7 dragonballs as obj (and you should :P) and they're all Dragonball_X where X is the number 1-7, use this code:

Code Revision:

mob
proc
deldballs() //del the dball proc
for(var/obj/dragonballs/O in src.contents) //use the for proc to run thru all the dballs
if(O) //if there is any in the users contents
del(O) //del them
sleep(15)
world << "The dragonballs have returned to normal!"
for(var/i=0,i<7,i++)
new text2path("obj/dragonballs/Dragonball_[i]")(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1)) //Were its going



If that way doesnt work (the code revision), ignore it