Postado Agosto 10, 2015 9 anos não funciona assim? function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest if item.itemid == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end ou function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest if Item(item):getId() == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Agosto 10, 2015 9 anos Autor não funciona assim? function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest if item.itemid == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end ou function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest if Item(item):getId() == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end Lua Script Error: [Action Interface] data/actions/scripts/reward_chest.lua:onUse data/actions/scripts/reward_chest.lua:4: attempt to index local 'player' (a number value) stack traceback: [C]: in function '__index' data/actions/scripts/reward_chest.lua:4: in function Lua Script Error: [Action Interface] data/actions/scripts/reward_chest.lua:onUse data/actions/scripts/reward_chest.lua:9: attempt to call method 'getActionId' (a nil value) stack traceback: [C]: in function 'getActionId' data/actions/scripts/reward_chest.lua:9: in function O erro continua. Teve esse erro também, Lua Script Error: [CreatureScript Interface] data/creaturescripts/scripts/reward_chest.lua:onKill data/creaturescripts/scripts/reward_chest.lua:229: attempt to call method 'getContentDescription' (a nil value) stack traceback: [C]: in function 'getContentDescription' data/creaturescripts/scripts/reward_chest.lua:229: in function 'doBossReward' data/creaturescripts/scripts/reward_chest.lua:248: in function Editado Agosto 10, 2015 9 anos por adrianinho (veja o histórico de edições)
Postado Agosto 10, 2015 9 anos function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest player = Player(player) if item.itemid == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Agosto 10, 2015 9 anos Autor function onUse(player, item, fromPosition, target, toPosition, isHotkey) --Reward Chest player = Player(player) if item.itemid == 21584 then if player:getExhaustion(REWARD_CHEST.STORAGE) > 0 then return player:sendCancelMessage('You need to wait ' .. string.diff(player:getStorageValue(REWARD_CHEST.STORAGE)-os.time()) .. ' before using this chest again.') end player:updateRewardChest() --Boss Corpse elseif item:getActionId() == 21584 then local reward = REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] if reward ~= nil then local rewardBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) addContainerItems(rewardBag, reward) if player:getCapacity() < rewardBag:getCapacity() then return player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY) end if player:addItemEx(rewardBag, false) == RETURNVALUE_NOERROR then REWARD_CHEST.LOOT[tonumber(item:getAttribute('text'))][player:getGuid()] = nil player:sendCancelMessage('You have picked a reward container.') else player:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM) return true end end end return false end Lua Script Error: [CreatureScript Interface] data/creaturescripts/scripts/reward_chest.lua:onKill data/creaturescripts/scripts/reward_chest.lua:229: attempt to call method 'getContentDescription' (a nil value) stack traceback: [C]: in function 'getContentDescription' data/creaturescripts/scripts/reward_chest.lua:229: in function 'doBossReward' data/creaturescripts/scripts/reward_chest.lua:248: in function Lua Script Error: [Action Interface] data/actions/scripts/reward_chest.lua:onUse data/actions/scripts/reward_chest.lua:10: attempt to call method 'getActionId' (a nil value) stack traceback: [C]: in function 'getActionId' data/actions/scripts/reward_chest.lua:10: in function
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.