ID:177449
 
Ok in my game when your first go ssj it reverts and makes your health go into the minuses. Then if u press ssj again u go ssj but u will have normal health and when u revert it will go back into the minuses. Can anyone fix this here is the code:


mob/Goku/verb/SSJ()
if(usr.level > 99)
if(usr.ssj == 0)
usr << "You turn SSj"
oview(6) << "[usr]'feels more power as his hair turns golden"
usr.underlays += 'ssjaura.dmi'
usr.icon = 'Person.dmi'
usr.icon_state = "SSJgoku"
usr.Powerlevel = usr.Powerlevel*4

usr.Str = usr.Str*4
usr.Def = usr.Def*2
ssj = 1
else
usr << "You revert from SSj"
oview(6) << "[usr]'s hair returns to normal as the aura from Super Saiyan dissapates"
usr.underlays -= 'ssjaura.dmi'
usr.icon = 'Person.dmi'
usr.icon_state = "Goku"
usr.Powerlevel = usr.Powerlevel/400000

usr.Str = usr.Str/4
usr.Def = usr.Def/2
ssj = 0
else
usr << "You are too weak!"
I see nothing related to health in here. Your problem is (most likely) usr.ssj is set to 1 beforehand. Also, using *=, +=, /=, -=, and most any operator followed by = has the sf X = X * B, so instead of usr.Powerlevel = usr.Powerlevel*4, have usr.Powerlevel *= 4. And don't you think dividing by 400 thousand is a bit much?
In response to Garthor
I have already tryed what u said and it does not work
Frieza111 wrote:
Ok in my game when your first go ssj it reverts and makes your health go into the minuses. Then if u press ssj again u go ssj but u will have normal health and when u revert it will go back into the minuses. Can anyone fix this here is the code:


mob/Goku/verb/SSJ()
if(usr.level > 99)
if(usr.ssj == 0)
usr << "You turn SSj"
oview(6) << "[usr]'feels more power as his hair turns golden"
usr.underlays += 'ssjaura.dmi'
usr.icon = 'Person.dmi'
usr.icon_state = "SSJgoku"
usr.Powerlevel = usr.Powerlevel*4

usr.Str = usr.Str*4
usr.Def = usr.Def*2
ssj = 1
else
usr << "You revert from SSj"
oview(6) << "[usr]'s hair returns to normal as the aura from Super Saiyan dissapates"
usr.underlays -= 'ssjaura.dmi'
usr.icon = 'Person.dmi'
usr.icon_state = "Goku"
usr.Powerlevel = usr.Powerlevel/400000

usr.Str = usr.Str/4
usr.Def = usr.Def/2
ssj = 0
else
usr << "You are too weak!"


The only thing I see wrong here is your power level formula. When you go SSJ shouldnt it times your power level by 400000? If not then it should be devided by 4 when you revert.
-DogMan
In response to Dog Man
Ok my problem is it reverts first not the pl /400000 that is ment to be /4 accidently put 400000 on here