• 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 getbankbalance - Private Guild Wars

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,051
Solutions
2
Reaction score
260
Location
United States
So i am trying to start a guild battle on my server, but whenever i accept a battle i get this error:

CPORXmV.png


The citywar script is here: http://pastebin.com/ve2DSika
The modalwindowhelper script is here: http://pastebin.com/2Tz1mFLr

If anyone can help i would really appreciate it ^^
 
tfw being tired is always your excuse for everything
getbankbalance doesnt exist
dont know what else to tell you
 
Code:
if inviterGuild:getBankBalance() < invite.options.buyIn then
(541)

This is the line. Remove it or fix it or dont use the script :p
 
guild has their own balances? didnt knew it
I used my brain and searched for a function like that and done

Code:
local function getGuildBalance(id)
    local guild = Guild(id)
    if guild then
        return guild:getBankBalance()
    else
        local balance
        local resultId = db.storeQuery('SELECT `balance` FROM `guilds` WHERE `id` = ' .. id)
        if resultId then
            balance = result.getNumber(resultId, 'balance')
            result.free(resultId)
        end
 
        return balance
    end
end
 
local function setGuildBalance(id, balance)
    local guild = Guild(id)
    if guild then
        guild:setBankBalance(balance)
    else
        db.query('UPDATE `guilds` SET `balance` = ' .. balance .. ' WHERE `id` = ' .. id)
    end
end
 
Last edited:
Back
Top