Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

NPC Auto Level Up

Newbie Spellweaver
Joined
Dec 24, 2018
Messages
19
Reaction score
0
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.

ChocolatThunder - NPC Auto Level Up - RaGEZONE Forums
 
Newbie Spellweaver
Joined
Jun 1, 2012
Messages
62
Reaction score
32
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:
Back
Top