ID:141086
 
Im trying to making it when you level you get a verb where you get a boost for a certain amount of time and when your mp is gone you revert.Also my mp won't decrease.

Code:
mob/verb
Power()
if(usr.Level==2)
usr.MP-=rand(1,2)
if(usr.MP<0)
if(istype(src,/mob/Class/Ninja))
Str+=usr.Str * 2
Def+=usr.Def * 2
src.icon='Ninja.dmi'
src.icon_state="2"


Problem description:
This is all i can come up with i know its horrible but it shows no errors,thanks for any help.
I'm not quite sure about anything else, but i think you wanted to do this for one part:

mob/verb
Power()
if(usr.Level==2)
usr.MP-=rand(1,2)
if(usr.MP<0)
if(istype(src,/mob/Class/Ninja)) // INDENTED
Str+=usr.Str * 2
Def+=usr.Def * 2
src.icon='Ninja.dmi'
src.icon_state="2"


also try adding things like

usr << "Testing 1"


in the code to see if it ever even reaches that line of code, and if it doesn't but should find out why, possibly even adding this instead as example for more helpful info.

usr << "Testing MP = [usr.MP]"
I think you'll find that it is decreasing, however not continuously. You need to place it in a loop. For example, while():

mob/verb
Power()
while(usr.Level==2)
usr.MP-=rand(1,2)
if(usr.MP<0)
if(istype(src,/mob/Class/Ninja))
Str+=usr.Str * 2
Def+=usr.Def * 2
src.icon='Ninja.dmi'
src.icon_state="2"


Please don't use that, as it is lousy and will not work, only causing you to pull your hair out. Well:

While usr.Level is 2, it will loop through that code continuously. However, it would be a good idea to include a Break somewhere. As I said: this is code will NOT work.
In response to Demon_F0rce (#2)
I tried that still doesn't work,any other ideas please.
In response to KatVonD (#3)
Prime example of "Ooh, code! Wait, it doesn't work!"
How about you read the rest of his post after the only part you read.

//Pwnage example of a while() loop.
mob
var
powuhz = 5
tmp/pwning
verb/pwnpeepz()
if(pwning) pwning = 0
else
pwning = 1
icon_state = "pwner" //pwnage icon state
src<<"You startz pwning!1!"
while(powuhz>0 && pwning)
src<<"You has [powuhz--] powuh!1!112" //liek drane 1 powuhz eech secund
sleep(10)
icon_state = "" //liek change back 2 norm state
powuhz = 0
src<<"You stops pwning!!1"


Don't use this code. If you do, I will call you a banana.
Is that an indentation typo from copy/pasting on "if(usr.MP<0)"? Or is it like that in the actual code.

Edit: Never mind, Morialis said it.
In response to KatVonD (#3)
Demon_F0rce wrote:
Please don't use that, as it is lousy and will not work, only causing you to pull your hair out.

_>. That is all I have to say, >_>.
In response to Kaiochao (#4)
Demon_F0rce wrote:
Please don't use that, as it is lousy and will not work, only causing you to pull your hair out.
Kaiochao wrote:
Prime example of "Ooh, code! Wait, it doesn't work!"
How about you read the rest of his post after the only part you read.
Etc

Man, wish they would legalize assault on people when they do that, eh? Or at least ban them from the forums. :D
Since people like that just copy anything, maybe they deserve someone to give them some code with fdel() looped or something that gets rid of their ripped source. Wonder if they'd still copy code afterward? ;) We could release a "cool Naruto gaem" library like that, but that'd be too cruel. Still, "Ripped Source Destroyer 2000" is a fun project name.