ID:145457
 
Code:
//Lords of Koroko-Softskydestruction, Friday, March 17, 2006.

mob
icon = 'person.dmi'

var
HP = 30
wealth = 0

Del()
var/mob/obj/gold/G = new(loc)
G.amount = rand(1,100)
..()

Login()
icon_state = gender
..()

Bug
icon = 'bug.dmi'

proc
Deathcheck()
if (HP <= 0)
world << "[src] dies!"
del(src)
verb

attack(mob/M as mob in oview(1))
if (M.HP <= 0)
usr << "[M] is already dead!"
else
usr << "You attack [M]!"
oview() << "[usr] attacks [M]"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.Deathcheck()

say(msg as text)

world << "[usr]: [msg]"

obj
gold
icon = 'gold.dmi'

var
amount

verb
get()
set src in view(1)
usr << "You pick up [amount] gold."
usr.wealth += amount
amount -= amount

turf
grass
icon = 'grass.dmi'

world
turf = /turf/grass


Problem description:

I can't get the gold to dissapear after it is taken.
It tryed put a "if" statement in the Gold object, after
amount -= amount


It said:
 if (amount = 0)
del(src)


All this does is make the gold goto 0, but it is still there.

Also how would I go about setting differnt HP's for the Bug and the PC? Right now they are both set at 30.

Just put del(src) at the end of the Get() verb. Also, to change an atom's (mob, ...) vars, you need to make them belong to them only.
Right now you have
mob/var/hp=30

So it'll be 30 hp on ALL monsters. Now, to change it, change it for all mobs seperately. Thus;
mob/bug/hp=50

Like that, the bug's HP will be 50.

Alos, after advancing with ZBT's tutorial, read the DM Guide. It might be confusing at first, but it's the best thing there is.
In response to Mysame
Thanks I will do!
obj
gold
icon = 'gold.dmi'
var
amount = 10
verb
get()
set src in view(1)
usr << "You pick up [amount] gold."
usr.wealth += src.amount
del(src)


You have obj/gold in mob. Obj's are thier own things. You don't need to do that. This should delete the gold after it is picked up.
In response to ArcaneVirus
I said that, chekc other topics.. o.o;;
In response to Mysame
obj
gold
icon = 'gold.dmi'

var
amount

verb
get()
set src in view(1)
usr << "You pick up [amount] gold."
usr.wealth += amount
del(src)

Like so?
When I do that the gold stays there. And you can still take gold from it.
In response to Softskydestruction
You've messed up the indendation, too. (the tabs).
Anyway, that should work.. But instead of [amount] , use [src.amount] (src = the gold in this case).
In response to Mysame
I got it to work!!!
Thanks...now to do the mob/bug hp thing...then to read the guide!