ID:263601
 
Code:


Problem description:

if(src.points<=0)
src.points=0
return
switch(input(src,"Distribute Points","[src.points] Points left",text) in list ("Health","Strength","Chakra","Defense","Speed","Stamina","Sav e for later"))
if("Health")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.maxhealth += P
usr.points -= P
if("Strength")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.atkstr += P
usr.points -= P
if("Chakra")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.maxchakra += P
usr.points -= P
if("Defense")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.Def += P
usr.points -= P
if("Speed")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.speed += P
usr.points -= P
if("Stamina")
if(src.points<=0)
src.points=0
return
else
var/P = input("How many","How many?") as num
usr.maxstam += P
usr.points -= P
if("Save for later")
return 0
goto start





thats my coding nd for some reason people can put w/e they want in the box nd it will give them that much of a bost?? help plz
You need to do a check to make sure that they do not try to use more than the number of points they actually have.

Something like:
if("Health")
src.points = max(src.points,0) //Sets src.points to whatever is larger, the actual value or 0.
if(src.points) //If they have any points
var/P = input("How many points would you like to spend on Health?","How many?") as num
if(P>src.points)
src << "You do not have that many points, you only have [src.points]"
return
else
src.maxhealth += P
src.points -= P

Also, don't use usr and when posting code, put it in the code section of the pre-formated post.

One final thing, try not to use goto. I am assuming you are just looping back to the beginning of the proc. You could use something like while() or just call the proc again at the end. (But make sure you can get out of it)
Lol, I'm sure it's your coding.
In response to Drumersl (#1)
Your using usr also :P