MorganaSacani
Active Member
- Joined
- Sep 20, 2022
- Messages
- 87
- Solutions
- 1
- Reaction score
- 32
I have a problem with my script
Whenever I use the !shop command, the result of my Tibia Coins increases.
I don't understand. Maybe some problem getting the value from the database?
For example, when I use the !shop command, trim the value 15 the first time, if I use the command again, 17 appears, and so on.
The script is not returning me the actual value in the database.
Whenever I use the !shop command, the result of my Tibia Coins increases.
I don't understand. Maybe some problem getting the value from the database?
For example, when I use the !shop command, trim the value 15 the first time, if I use the command again, 17 appears, and so on.
The script is not returning me the actual value in the database.
Lua:
local shop = TalkAction("!shop")
function shop.onSay(player, words, param)
player:registerEvent("ModalShop")
local getCoins = db.storeQuery("SELECT `coins` FROM `accounts` WHERE `id` = " .. player:getAccountId())
local title = "Game Store"
local message = "You have ".. getCoins .." Tibia Coins."
local window = ModalWindow(1000, title, message)
window:addButton(100, "Confirm")
window:addButton(101, "Cancel")
window:addChoice(1, "Premium Scroll - Price: ".. premiumScrollPrice ..".")
window:addChoice(2, "Magic Gold Converter - Price: ".. magicGoldConverterPrice ..".")
window:setDefaultEnterButton(100)
window:setDefaultEscapeButton(101)
window:sendToPlayer(player)
return true
end
shop:register()