ID:149024
 
I can't figure out the problem with my power up code, could someone please help me. here is the code.

mob/verb
Power_Up()
set category = "Techniques"
if(usr:PL<usr:maxPL)
usr.PL=usr.maxPL
else
usr << "Your Already At Full Power!"
your indention is crap, the if and else statements should be back one tab, and that includes everything inside them, and next time, state the problem rather than, IT DOESN'T WORK. usually with a code problem something doesn't work.

mob/verb
Power_up()
set category = "Techniques"
if(usr.PL==usr.max_PL)
usr.PL = usr.max_PL
else
usr << "You just suck."
Del(world)

MAKE CERTAIN TO USE THAT LAST LINE!

*snicker* *snicker*
In response to Ter13
Yo, sorry, I'm new here, aight. The problem is, that the powerlevel doesn't go up and it says invalid expression in this line:
if(usr:PL<usr:maxPL)
In response to Kamion
ROFLAMO!!!!!!!!!

ok, the problem is... those colons, they have to go. you can't do that! variables are accessed with periods it should be usr.PL, not usr:PL... maybe you should learn to walk in BYOND, rather than run and then perfect walking?
In response to Ter13
Hes a newbie dont be mean =;P
In response to Kamion
Kamion wrote:
Yo, sorry, I'm new here, aight. The problem is, that the powerlevel doesn't go up and it says invalid expression in this line:
if(usr:PL<usr:maxPL)

the colon isnt the reason your getting the error but its best to use a period instead.the reason you got the error is because you need to add an equeals sign after the less-than sign
In response to Emperor Beld
No. < is less then, <= is less then or equal too. If he used <= instead of < the proc wouldnt do what it was meant to. Niether or them would cause a actual error message though.
-DogMan
In response to Kamion
Kamion wrote:
Yo, sorry, I'm new here, aight. The problem is, that the powerlevel doesn't go up and it says invalid expression in this line:
if(usr:PL<usr:maxPL)


Try this
if(usr.PL = usr.maxPL)

or maybe...

mob/verb
Power_up()
set category = "Techniques"
if(src.PL==src.max_PL)
src.PL = src.max_PL
else
usr << "Yeh cant powerup dammit, yeh already got the Puuwer."
In response to Emperor Beld
I SLAP YOU!
In response to Ter13
That comment wasn't very helpful, and I notice you've been posting a lot of useless comments lately. No offence, but I'd appreciate it if you (a) made more serious comments than annoying ones or (b) made no comments at all. There's enough to read on the forums already without having to scroll through pages of gibberish.

Thankyou. :)