Well i want a level up system so that when you level up you can choose the stats that you want to increase but when he does level up and gets the choice to increase a a certain stat 3 times it doesnt increase the stat.This is what i Have.
mob
proc
level()
if(usr.Experience >= usr.MaxExperience)
usr.Level += 1
usr.MaxExperience += usr.MaxExperience
usr.Experience = 0
switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5"))
if("Strength")
src.Strength += 1
if("Defense")
src.Defense += 1
if("HP")
src.HP += 5
if("MP")
src.MP += 5
switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5"))
if("Strength")
src.Strength += 1
if("Defense")
src.Defense += 1
if("HP")
src.HP += 5
if("MP")
src.MP += 5
switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5"))
if("Strength")
src.Strength += 1
if("Defense")
src.Defense += 1
if("HP")
src.HP += 5
if("MP")
src.MP += 5
else
return
ID:148344
Mar 23 2003, 10:41 am
|
|
Mar 23 2003, 10:45 am
|
|
Well, it's obviously not the mix of usr and src, THAT'S for sure!
|
Jem wrote:
Well i want a level up system so that when you level up you can choose the stats that you want to increase but when he does level up and gets the choice to increase a a certain stat 3 times it doesnt increase the stat.This is what i Have. Well where you put switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5")) if("Strength") src.Strength += 1 if("Defense") src.Defense += 1 if("HP") src.HP += 5 if("MP") src.MP += 5 change the if("Strength") and etc to if("Strength+1") Its not reading the strength+1 and etc its searching for strength. |
In response to Cloudiroth
|
|
It should look like this:
mob proc level() if(usr.Experience >= usr.MaxExperience) usr.Level += 1 usr.MaxExperience += usr.MaxExperience usr.Experience = 0 switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5")) if("Strength+1") src.Strength += 1 if("Defense+1") src.Defense += 1 if("HP+5") src.HP += 5 if("MP+5") src.MP += 5 switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5")) if("Strength+1") src.Strength += 1 if("Defense+1") src.Defense += 1 if("HP+5") src.HP += 5 if("MP+5") src.MP += 5 switch(input("What stat do you Want to Increase?","???")in list("Strength+1","Defense+1","HP+5","MP+5")) if("Strength+1") src.Strength += 1 if("Defense+1") src.Defense += 1 if("HP+5") src.HP += 5 if("MP+5") src.MP += 5 else return --------------------------EDIT---------------------------- You don't have to use two tabs you can use one if you use it all the time that is. |
Since usr isn't safe in procs (for the most part), you shouldn't use it here. Use src instead.
Also, you need to change all your input() calls to use src as well, like input(src,...) instead of input(...). After each one I'd also put in a safety check: if(!client) for(var/i=0, i<3, ++i) Lummox JR |