runtime error: type mismatch
proc name: DblClick (/mob/Human_Master/DblClick)
source file: npc.dm,15
usr: Plague (/mob/Human)
src: Human Master (/mob/Human_Master)
call stack:
Human Master (/mob/Human_Master): DblClick(Dragonball - Journey of Power (83,8,1) (/turf/grass))
Coding:
mob
Human_Master
icon = 'npc.dmi'
icon_state = "humandojo"
npc = 1
DblClick()
if(!usr.dojo)
alert("Welcome to the Dojo.")
alert("In order to leave this Dojo you must complete certain tasks to become a warrior with a Novice fighting style.")
alert("First, let me test your ki level and determine your Center of Gravity.")
usr.SetCGrav()
alert("Now that I have determined your Center of Gravity, go and begin to train and become a great warrior. Come back to me when you think you have reached your limit.")
usr.dojo = 1
else
if(usr.powerlevel < 10)
alert("You are still not strong enough to leave this island. Come back soon though.")
else
alert("Ahh, my son you have finally reached the limit of my training. Here, enjoy your new fighting style.")
usr.style = "Novice"
alert("Oh yea, you might want to learn a little bit about your fighting style.")
alert("Your fighting style determines how you attack and also increases your damage.")
alert("This style was fairly easy to acquire, but the next styles will not be as easy.")
alert("Good luck my young warrior!")
Any idea here?
"You tried to perform a mathematic operation that doesn't make sense. For example, addition involving a number and a text string, or any other two var types that don't mix easily. (Hint: Use num2text() and text2num() to convert between numbers and text.)
Another possible cause of a type mismatch error is that you tried to add something to a list, but the list wasn't actually created. See "Cannot read null.Find()" below for ways to properly define a list."
Well, this has nothing to do with lists, so the only thing that could possibly be wrong here is
if(usr.powerlevel < 10)
Therefore, usr.powerlevel is probably some sort of text value. The truth is, depending on your game, mob.powerlevel should probably be a numerical variable, and not a text one.
Of course, there's the obvious design error to repair, but if you must keep mob.powerlevel as a text variable (Not Recommended!), then use text2num():
In the future, please don't make a completely new topic for things like this. This is merely a continuation of your previous problem, so it should therefore be in the previous problem's thread.