-
Apprentice
NPC Auto Level Up
Heya Isyans.
Today I was working on an npc that has the function of uploading a level if you deliver an item in specific.
The problem is that the npc do the level up function but does not take away the inventory item, and it does indefinitely, that is, you level up each time you click the "levelup" button.
Could someone give me the necessary clues to know what I'm doing wrong?
Thanks in advance.
-
-
Member
Re: NPC Auto Level Up
Assuming cGetItemLot returns the amount of times the item occurs in the inventory (keep in mind that I do not know what it does exactly but that's what I can imagine it doing), comparing this to nil would not work since nil represents the absence of a value. cGetItemLot will most likely not return nil and always return a real number (0 if it does not occur in the inventory).
Comparing a variable that stores a real number with a nil will therefore not work.
What you most likely want to do in that case is check if the cGetItemLot is bigger or equal than the Var.Item.Lot (or its inverse, checking if it's smaller -> trigger the script with Var.ScriptMsg.Fail).
Last edited by Erblin; 28-12-18 at 03:51 AM.