sadguys
New Member
- Joined
- Jul 20, 2017
- Messages
- 3
- Reaction score
- 0
Hey guys! I need a script that transform an item (Tibia Coin) into an ingame Store Coin; i've tried this:
-ITEMS.XML:
<item id="24774" article="a" name="Tibia coin">
<attribute key="weight" value="0" />
<attribute key="description" value="Tibia Coins are needed to shop exclusive products in the Store, including fabulous mounts, classy outfits, a Name Change or even Premium Time." />
</item>
- TIBIACOIN.LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local points = 10
db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. points .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você recebeu "..points.." coins")
item:remove(1)
return true
end
- actions.xml
<action itemid="24774" script="other/tibiacoin.lua"/>
-ITEMS.XML:
<item id="24774" article="a" name="Tibia coin">
<attribute key="weight" value="0" />
<attribute key="description" value="Tibia Coins are needed to shop exclusive products in the Store, including fabulous mounts, classy outfits, a Name Change or even Premium Time." />
</item>
- TIBIACOIN.LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local points = 10
db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. points .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você recebeu "..points.." coins")
item:remove(1)
return true
end
- actions.xml
<action itemid="24774" script="other/tibiacoin.lua"/>