Você complicou o negócio
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2626 and getPlayerStorageValue(cid, 13195) == -1 then
doRemoveItem(item.uid,1)
setPlayerStorageValue(cid, 13195, 1)
setPlayerStorageValue(cid, 13194, -1)
doSendMagicEffect(frompos, 13)
doBroadcastMessage("The ".. getPlayerName(cid) .." found a new key to Spret Room.", 22)
doRemoveCreature(cid)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already use it.")
end
end
vê se assim n funfa






info
Group: Artesão
Joined: 24/06/07
Posts: 104
Reputation: +3
Tibia Character: Tavas
Boas pessoal... estou tentando fazer com que um item adicione uma storage X e remova uma Y
meu Scripit...
function onUse(cid, item, frompos) Query = db.getResult("SELECT `value`, `player_id`, `key` FROM `player_storage` WHERE `player_storage`.`player_id` = ".. getPlayerGUID(cid) ..";") if item.itemid == 2626 and getPlayerStorageValue(cid,13195) == -1 then doRemoveItem(item.uid,1) setPlayerStorageValue(cid,13195,1) doSendMagicEffect(frompos,13) doBroadcastMessage(" The ".. getPlayerName(cid) .." found a new key to Spret Room.") doRemoveCreature(cid) db.executeQuery("DELETE FROM `player_storage` WHERE `player_storage`.`player_id` = "..getPlayerGUID(cid).." AND `player_storage`.`key` = 13194 ;") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already use it") end endERRO NO SERVER \/ quando o player faz lought --- > doRemoveCreature(cid)
[Error - Action Interface] data/actions/scripts/shop/other/pawn.lua:onUse Description: (internalGetPlayerInfo) Player not found when requesting player info #18 [Error - Action Interface] data/actions/scripts/shop/other/pawn.lua:onUse Description: data/actions/scripts/shop/other/pawn.lua:12: attempt to concatenate a boolean value stack traceback: data/actions/scripts/shop/other/pawn.lua:12: in function <data/actions/scripts/shop/other/pawn.lua:1>Espero que alguem me possa ajudar..