ID:139259
 
Code:mob
icon= 'player.dmi'
Login()
loc = locate(/turf/start)
..()
var/health = 100
icon_state= "1"
var/cool = 1


proc/ouch(D)
health = health - D
if(health < 0)
view() << "[usr] oh no im dead!"
health = health + H
loc= locate (/turf/start)
if(health <0)
if cool= 1
loc = locate(/turf/start)
if cool= 0
del src



Problem description:code1.dm:18:error: missing condition
code1.dm:20:error: missing condition

the var cool is getting a missing condtion error
</0></0>
you gotta put your code inbetween the dm markers lol
In response to Saladon
can you tell me what that meansn
In response to Laserdog
He means, when you post in codeproblems, you're presented with DM tags. If you put your code inside them, they'll come out all pretty like this:
mob/Login() world << "HI"


The problem with your code:
    if(health <0)
if cool= 1
loc = locate(/turf/start)
if cool= 0
del src


You stopped using brackets in your if statements, and = is used for assigning, not comparing. Use == to compare.
In response to Murrawhip
Murrawhip wrote:
He means, when you post in codeproblems, you're presented with DM tags. If you put your code inside them, they'll come out all pretty like this:
> mob/Login() world << "HI"
>

The problem with your code:
>   if(health <0)
> if cool= 1
> loc = locate(/turf/start)
> if cool= 0
> del src
>

You stopped using brackets in your if statements, and = is used for assigning, not comparing. Use == to compare.

>   proc/ouch(D)
health = health - D
if(health < 0)
view() << "[usr] oh no im dead!"
health = health + H
loc= locate (/turf/start)
if(health <0)
if() cool == 1
loc = locate(/turf/start)>
if() cool == 0
del src

if() cool == 0

code1.dm:20:error: missing expression

what did i do wrong
In response to Laserdog
Laserdog wrote:
    proc/ouch(D)
health = health - D
if(health < 0)
view() << "[usr] oh no im dead!"
health = health + H
loc= locate (/turf/start)
if(health <0)
if() cool == 1
loc = locate(/turf/start)>
if() cool == 0
del src

what did i do wrong

Look at the other if statements in your code that are programmed correctly - then look at yours.
In response to Murrawhip
okay i have a npc thats cool var = 0 but for some reason it dosent get delted when i lower its health to 0
In response to Laserdog
It should be..
if(health <= 0) 
//if it is equal to 0 it gets del.
//if it is less than 0, same thing


Also your second if statement is not indented properly.