ID:148527
 
ok i want to put thou grav in my game and when i try to put it in it gives me errors about random and stamina how do i fix it this is what the code looks like and if someone can fix my prob will give 5 dimes

thougrav
Enter()
if(usr.maxpowerlevel >= 1000000)
usr.random = rand(1,30)
if(usr.random == 29)
usr << "You struggle a bit because of the gravity..."
usr.maxpowerlevel += (rand(1,2000))
if(usr.random == 30)
usr << "
You walk on this planet without a problem."

if(usr.maxpowerlevel >= 100000 && usr.maxpowerlevel <= 1000000)
usr.random = rand(1,12)
if(usr.random == 1)
usr << "You walk through the gravity of this planet without a problem."
usr.powerlevel -= (rand(1,3000))
if(usr.random == 2)
usr << "
You feel a strained walking on this planet."
usr.stamina -= (rand(0,1))
usr.powerlevel -= (rand(1,9000))
if(usr.powerlevel > 0)
usr.maxpowerlevel += (rand(0,150))
else
usr.KO()
usr.loc=locate(95,117,2)
usr << "You are sent back to Kaios because this grav
waht exactly does tha errors say?
usr is not valid in Enter(). Enter() has an argument for the mob entering it.
like garthor said, don't use usr in Entered. I think you can do it like this althought i'm not sure. Also, close your html tags.
turf
thougrav
Entered(mob/P)
if(P.maxpowerlevel >= 1000000)
P.random = rand(1,30)
if(P.random == 29)
P << "<b>You struggle a bit because of the gravity...</b>"
P.maxpowerlevel += (rand(1,2000))
if(P.random == 30)
P << "<b>You walk on this planet without a problem.</b>"

if(P.maxpowerlevel >= 100000 && P.maxpowerlevel <= 1000000)
P.random = rand(1,12)
if(P.random == 1)
P << "<B>You walk through the gravity of this planet without a problem.</b>"
P.powerlevel -= (rand(1,3000))
if(P.random == 2)
P << "<b>You feel a strained walking on this planet.</b>"
P.stamina -= (rand(0,1))
P.powerlevel -= (rand(1,9000))
if(P.powerlevel > 0)
P.maxpowerlevel += (rand(0,150))
else
P.KO()
P.loc=locate(95,117,2)
P << "<b>You are sent back to Kaios because this gravity </b>"
the error it keeps giving me is undefined var
In response to Nyght
Those vars aren't defined.