Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
I am attempting to make a quest chest to give a player addons based on vocation. The chest opens, gives the storage ID. No addon rewarded. No errors on console. Using tfs 1.2, how bad am I off?
Code:
local storage = 15485
local outfits = {
{138,3}, -- 1
{148,3}, -- 2
{137,3}, -- 3
{139,3} -- 4
}
local msg = ''
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(storage) < 1 then
for vocId, items in ipairs(outfits) do
if player:getVocation():getBase():getId() == vocId then
for i = 1, #items do
--add players addon based on Vocation/sex (player:addItem(items[i]))
doPlayerAddOutfit(items[i])
end
msg = "Yay, free shit!"
end
end
player:setStorageValue(storage, 1)
else
msg = "chest is empty."
end
player:sendTextMessage(MESSAGE_INFO_DESCR, msg)
return true
end