ID:175401
 
My code is supposed to see if your at level 5 and are a certain race, if you are the race and at level 5 it asks you if you want to learn a new spell or not. The problem is that it wont even ask if i want to learn the spell, Here's my coding:
mob/proc
Levelup()
if(src.experience>=src.maxexperience)
src.level += 1
if(src.level == 5)
if(istype(src,/mob/player/Lizard))
switch(input("Would you like to learn Walk on Water?") in list("Yes", "No"))
if("Yes")
src.verbs += /mob/spells/verb/Walk_on_water
src.maxexperience*=2
src << "You are now level [src.level]!"
src.Statup()


Please help me fix this coding! Thanks in advance!
Are you calling the proc? If so, are you sure that you're actually level 5 and that you're the right race?
In response to Goku72
yeah im calling it when ever you get exp. And i've made sure im level 5 and that race. And i know the Levelup part works because it says You are now level 5! when i level up to level 5 but it doesnt ask if you want to learn the spell or not
You are getting input from usr, when you should be getting input from src. The first argument of input() is usr by default, and is usually left as so.
I fixed it, the problem was in my charhandling but it's fixed now, thanks for all your help anyway!