Jump to content

Fix Cheque / Won and Gold Exchange


Recommended Posts

Hey all,

easy to fix but I'm releasing because I realized many of servers(and devs) have this problem


problem description: when you enter decimal number in Won Exchange window (like 1.5) it will be exchanged for 150,000,000 but it will remove 1 won only so you got yang more than you should get.


after checking some cheque systems (including WLsj24 ones)

in quests they have check like:

if ((amount < 1) or (amount >19) or (amount == nil)) then

and it's true except that check from 1 to 19 includes decimal numbers too

so if you write 1.5 it will be exchanged to 150,000,000 and only remove 1 Won

so you should put a check for INT, you can modify it to be:

if ((amount < 1) or (amount >19) or (amount == nil) or (math.floor(amount) ~= amount)) then

(if the floor of amount is equal to amount so it's INT, otherwise it's not int)

Best Regards.

Edited by Asentrix
Link to comment
Share on other sites

3 hours ago, Bizzy said:

hmm when a make it like 1,5 or 1.5 nothing happend 


your problem is clear, "attempt to compare nil with number"

if you can't solve just put the quest

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.