ID:180088
 
Ok ythe following code has an error on line 56, BYOND Say
56:error:usr.wealth.bad var

Whats am i doin wrong




mob
icon = 'boatyou.dmi' //make it so all mobs will be created with the person icon
var
HP = 30 //define a new variable called HP, with a value of 30

enemyboat
icon = 'enemyboat.dmi'

Del()

var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(1,100) //set its amount variable randomly
..() //call the parent

Login()
icon_state = gender //when a player logs in, get them the right icon state for
..() //the gender of their key. Then call the parent!

proc
DeathCheck() //check to see if an attack is deadly
if (HP <= 0) //if the defender's HP is low enough...
world << "[src] dies!" //give the death messaging
del(src)
verb
attack(M as mob in oview(1))
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]"

turf
water //define a "grass" prototype, which is a kind of turf...
icon = 'water.dmi' //that has an icon named 'grass.dmi'. In single quotes!

world //set one of our world's characteristics:
turf=/turf/water //its default turf is the grass turf.





obj
gold
icon = 'gold.dmi'
var
amount
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.wealth + amount //add to usr.wealth
del(src) //delete

RagnarofBurland wrote:
Ok ythe following code has an error on line 56, BYOND Say
56:error:usr.wealth.bad var

You didn't make a "wealth" variable for mob.
RagnarofBurland wrote:
Ok ythe following code has an error on line 56, BYOND Say
56:error:usr.wealth.bad var

Where is wealth defined?

usr is always considered to be /mob, so if you didn't define it under /mob it wouldn't work.
In response to Deadron
Deadron wrote:
RagnarofBurland wrote:
Ok ythe following code has an error on line 56, BYOND Say
56:error:usr.wealth.bad var

Where is wealth defined?

usr is always considered to be /mob, so if you didn't define it under /mob it wouldn't work.

Thaks i fixed it
In response to Cinnom
Cinnom wrote:
RagnarofBurland wrote:
Ok ythe following code has an error on line 56, BYOND Say
56:error:usr.wealth.bad var

You didn't make a "wealth" variable for mob.

Wheres the indentaion error on line 16 and 17 for dis code

mob
icon = 'boatyou.dmi' //make it so all mobs will be created with the person icon
var
HP = 30 //define a new variable called HP, with a value of 30

enemyboat
icon = 'enemyboat.dmi'

Login()
icon_state = gender //when a player logs in, get them the right icon state for
..() //the gender of their key. Then call the parent!

proc
DeathCheck() //check to see if an attack is deadly
if (HP <= 0) //if the defender's HP is low enough...
world << "[src] dies!" //give the death messaging
del(src)
verb
attack(M as mob in oview(1))
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]"

turf
water //define a "grass" prototype, which is a kind of turf...
icon = 'water.dmi' //that has an icon named 'grass.dmi'. In single quotes!

world //set one of our world's characteristics:
turf=/turf/water //its default turf is the grass turf.