yogiikke
:D
- Joined
- Mar 24, 2013
- Messages
- 59
- Reaction score
- 9
Hello i got a quest script and first it gave me a chest not the item itself so i messd arround with it with the storage values the item uid. tryd to look some guides for scripting with tfs 1.1 (didnt found any ) etc. tryd everything my mind could think of and now all it says Its Empty! tryd with diffrent characters (new ones) and still says its empty! it doesnt give any errors it just says its empty! help. :/
Quest.lua
actions.xml
Quest.lua
Code:
local chests =
{
[9148] = {itemid = 2495, count = 1},
[9149] = {itemid = 8905, count = 1},
[9150] = {itemid = 16111, count = 1},
[9151] = {itemid = 16112, count = 1}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if chests[item.uid] then
if player:getStorageValue(40564) ~= 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
return true
end
local chest = chests[item.uid]
local itemType = ItemType(chest.itemid)
if itemType then
local article = itemType:getArticle()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. (#article > 0 and article .. ' ' or '') .. itemType:getName() .. '.')
end
player:addItem(chest.itemid, chest.count)
player:setStorageValue(40564, 2)
end
return
true
end
actions.xml
Code:
<action fromuid="9148" touid="9151" script="quests/Quest.lua" />