ID:142765
 
Code:
mob
var/skill_points
verb
Spend_Skill_Points()
switch(input(usr,"Distribute Points","[src.skill_points] remaining",text) in list ("Health","Reiatsu","Attack","Defense","Reiatsu Power"))
if("Health")mhealth += input("How many points do you want to use on health","[src.skill_points] remaining",text)as num
if("Reiatsu")mrei += input("How many points do you want to use on reiatsu","[src.skill_points] remaining",text)as num
if("Attack")attack += input("How many points do you want to use on attack","[src.skill_points] remaining",text)as num
if("Defense")defence += input("How many points do you want to use on defence","[src.skill_points] remaining",text)as num
if("Reiatsu Power")reiatsu += input("How many points do you want to use on reiatsu power","[src.skill_points] remaining",text)as num
if(skill_points <0 && skill_points <= src.skill_points)
src.skill_points -= skill_points

src <<"You now have [src.skill_points] points"


Problem description:The Problem is that it gives the player a unlimited ammount of skill points whether they have them or not the way we had it set up was the Owner would be able to award them as a prize but a player pointed out the prob and we removed it from game untill the problem can be resolved anyone have any clues on how to fix this

            if(skill_points <0 && skill_points <= src.skill_points)
src.skill_points -= skill_points


I wouldn't name a variable in a proc after a player's variable; it could get confusing. Change it to:

if(points <= src.skillpoints && points >= 1)
src.skill_points -= points
// Do whatever here


Also, you are doing the check to see if they have enough skill points after they've added points to a selected skill.

            var/skill = input("What skill do you want to spend the points on?","Blah")in list("1","2","3","4")
var/number = input("How many skill points do you want to spend?")as num
if(src.skill_points >= number && number >= 1) // or you can do number <= src.skill points. Optional decision.
switch(skill)
if("1")
src.skill1 += number
//Do whatever
if("2")
src.skill2 += number
//Do whatever
if("3")
src.skill3 += number
//Do whatever
if("4")
src.skill4 += number
//Do whatever
src.skill_points -= number
else
alert(src,"Failed! Please try again.")
You're only removing skill points if there aren't any to remove. Here's a way to better organize this and fix your problem:

    verb/spend_skill_points()
if(usr.skill_points < 1) // if the player has no skill points...
// ...don't let him spend any!
usr << "You don't have enough skill points."
return

// This determines which stat the user will spend his points on:
var/stat = input(usr,"Which stat will you spend your skill points on?") as null|anything in list("Health","Reiatsu",\
"Reiatus Power","Attack","Defence")
if(!stat) return

// And this determines how many stat points will be spent on [stat]:
var/amount

/*
This loop prevents the player from spending less than
zero stat points or more than he has. Look up do-while
loop in the reference if you don't understand how this
works.
*/


do
amount = input(usr,"How many skill points will you spend on [stat]?") as num
while(amount < 1 || amount > usr.skill_points)

// Finally, we spend the stat points:
skill_points -= amount
switch(stat)
if("Health") mhealth += amount
if("Reiatsu") mrei += amount
if("Attack") attack += amount
if("Defense") defence += amount
if("Reiatsu Power") reiatsu += amount
usr << "You spent [amount] skill point\s on [stat] and now have [skill_points]."