• 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!

change msg in script

vitorelias1

New Member
Joined
Sep 27, 2022
Messages
27
Reaction score
2
hello guys

Is it possible to change this part of the script? I wanted the message to look like this
You paid d% gps from your bank account. Your balance went from d% to d% gps.

You paid 100 gps from your bank account. Your balance went from 417779 to 417679 gps.



self:removeMoney(math.min(amount, moneyCount))
if amount > moneyCount then
self:setBankBalance(bankCount - math.max(amount - moneyCount, 0))
if moneyCount == 0 then
self:sendTextMessage(MESSAGE_INFO_DESCR, ("Paid %d gold from bank account. Your account balance is now %d gold."):format(amount, self:getBankBalance()))
else
self:sendTextMessage(MESSAGE_INFO_DESCR, ("Paid %d from inventory and %d gold from bank account. Your account balance is now %d gold."):format(moneyCount, amount - moneyCount, self:getBankBalance()))
end
end
return true
end
 
Solution
Lua:
    self:removeMoney(math.min(amount, moneyCount))
    if amount > moneyCount then
        local newBalance = bankCount - math.max(amount - moneyCount, 0)
        self:setBankBalance(newBalance)
        if moneyCount == 0 then
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d gold from bank account. Your account balance went from %d to %d gps."):format(amount, bankCount, newBalance))
        else
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d from inventory and %d gold from bank account. Your account balance went from %d to %d gps."):format(moneyCount, amount - moneyCount, bankCount, newBalance))
        end
    end
    return true
end
Lua:
    self:removeMoney(math.min(amount, moneyCount))
    if amount > moneyCount then
        local newBalance = bankCount - math.max(amount - moneyCount, 0)
        self:setBankBalance(newBalance)
        if moneyCount == 0 then
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d gold from bank account. Your account balance went from %d to %d gps."):format(amount, bankCount, newBalance))
        else
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d from inventory and %d gold from bank account. Your account balance went from %d to %d gps."):format(moneyCount, amount - moneyCount, bankCount, newBalance))
        end
    end
    return true
end
 
Solution
Lua:
    self:removeMoney(math.min(amount, moneyCount))
    if amount > moneyCount then
        local newBalance = bankCount - math.max(amount - moneyCount, 0)
        self:setBankBalance(newBalance)
        if moneyCount == 0 then
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d gold from bank account. Your account balance went from %d to %d gps."):format(amount, bankCount, newBalance))
        else
            self:sendTextMessage(MESSAGE_INFO_DESCR, ("You paid %d from inventory and %d gold from bank account. Your account balance went from %d to %d gps."):format(moneyCount, amount - moneyCount, bankCount, newBalance))
        end
    end
    return true
end
thank you bro!
 
Back
Top