• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua NPC Naji (Bank System)

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
hello guys, i need help for npc bank, need that when one player withdraw 1kk he give one bar of gold item 15515
 
the source has been edited, Naji not recognize the new money.


ITEM_GOLD_COIN = 2148,
ITEM_PLATINUM_COIN = 2152,
ITEM_CRYSTAL_COIN = 2160,
ITEM_BAR_OF_GOLD = 15515,


case ITEM_BAR_OF_GOLD:
return count * 1000000;


registerEnum(ITEM_CRYSTAL_COIN)
registerEnum(ITEM_BAR_OF_GOLD)


if (itemId != ITEM_GOLD_COIN && itemId != ITEM_PLATINUM_COIN && itemId != ITEM_CRYSTAL_COIN && itemId != ITEM_BAR_OF_GOLD) {

function getMoneyWeight(money)
local gold = money
local bgold = math.floor(gold / 1000000)
gold = gold - bgold * 1000000
local crystal = math.floor(gold / 10000)
gold = gold - crystal * 10000
local platinum = math.floor(gold / 100)
gold = gold - platinum * 100
return (ItemType(15515):getWeight() * bgold) + (ItemType(2160):getWeight() * crystal) + (ItemType(2152):getWeight() * platinum) + (ItemType(2148):getWeight() * gold)
end
 
Last edited:
Back
Top