ID:261290
 
When monsters on my game die, I want the map to be repopulated. So I looked up the Repop(), it seems simple enough, but I don't understand what I have to do to get it to work. I'm not sure where I have to put it so that I dont get any errors, or what to put in the "()"'s, if anything. Could somone please clear this up for me?
_________________
=The Bearded One=
_________________
Within your deathcheck proc (or whatever you call it) where you check the if the client is null you need to call it something like this

mob
proc
death()
if(src.client)
//Normal player deaths
else
del(src)
sleep(300)//Let it wait a bit before repopulating
world.Repop()//Call the Repop proc using world. because it's a world proc.
In response to Light
Thank you Light, but I didn't work for me, what am I doing wrong?

if(src.typechar == "monster")
if(src.HP <= 0)
view() << "[src.name] dies!"
del(src)
sleep(10) world.Repop()
In response to I Have A Beard
Move the Repop down one line and your indentation looks kind of off.
In response to Nadrew
Whoops, I don't know why it looks like that, it looks different in my coding.

if(src.typechar == "monster")
if(src.HP <= 0)
del(src)
sleep(10)
world.Repop()

It get's no errors, but it doesnt repop.
In response to I Have A Beard
I Have A Beard wrote:
Whoops, I don't know why it looks like that, it looks different in my coding.

if(src.typechar == "monster")
if(src.HP <= 0)
del(src)
sleep(10)
world.Repop()

It get's no errors, but it doesnt repop.

I have not used Repop, but I believe when you del(src), this proc dies along with the src, so it never gets to the rest of it.
In response to Flick
Yes, that means you have to make a proc that does it before it's deleted:

proc
repopulate()
sleep(20)
world.Repop()
mob
proc
deathcheck()
if(!src.client)
repopulate()
del(src)
else
src.loc=locate(1,1,1)


I'm sure you can add that into your code.