ID:140089
 
Code:
usr.random=rand(1,6)
if(usr.random==1)
usr.Element="Fire"
if(usr.random==2)
usr.Element="Water"
if(usr.random==3)
usr.Element="Earth"
if(usr.random==4)
usr.Element="Wind"
if(usr.random==5)
usr.Element="Lightining"
if(usr.random==6)
usr.Element="Ice"


Problem description:

When i compile it says usr.random: undefined var

In response to Darkjohn66
I read that already
In response to Alkhalif10
Oops...My Bad. Well, its not my fault, its just that

In response to Darkjohn66
I didn't say i read the guide already i said i read that post already....
In response to Darkjohn66
Darkjohn66 wrote:
Yes, that is why you do not know how to fix one of the most basic errors. An undefined variable.

> mob/verb/I_Already_Read_Guide()
> usr.hitpoints+=20
>
> Line 2:Error:Undefined Variable
>

> mob/var
> hitpoints = 100
> mob/verb/I_Actually_Read_The_Guide()
> usr.hitpoints+=20
>


What does that have to do with usr.random: undefined var
You have not defined a variable belonging to mobs with the identifier of random.

Also note that there's really no reason to ever do so, as you can just declare a variable locally to the procedure.

Also note that there's no reason to do that either, here, as you can instead use pick().