ID:175859
 
mob
var
fight = 0
hptmp = 0
choice
player

verb
Attack(mob/M as mob in oview(1))
set category = "Actions"

player = M

while(player.fight == 1)
if(player == M)
player = src
else
player = M

player.Choice = 0


why do i get these errors?
test.dm:14:error:player.fight:undefined var
test.dm:20:error:player.Choice:undefined var
You haven't told the compiler what kind of var <code>player</code> is, so it doesn't know that it has a <code>fight</code> var. By the compiler's reasoning, <code>player</code> is not neccessarily a mob, so it won't neccessarily have the <code>fight</code> var.

What you have to do is tell the compiler that <code>player</code> will always be a mob; you do that by defining it as <code>mob/player</code> instead of <code>player</code>.

Note that you still refer to it as <code>player</code> when you use it; the <code>mob/</code> bit just tells the compiler that it's a mob.
woah nice^_^ Thanks