error656
New Member
- Joined
- Aug 27, 2007
- Messages
- 60
- Reaction score
- 1
Hello
I want to ask you about chest witch player can open only if he have enought lvl. I was using that script:
and its working fine, but now i using older version of TFS with is not supporting local config. Is there anybody who can rebuild this script?
Oh and i search on forum something helpful but nothing found.
Thanks for helping!
I want to ask you about chest witch player can open only if he have enought lvl. I was using that script:
local CONFIG =
{
[50003] = { -- Chest Unique ID
chestLevel = xx, -- Player Level
chestStorage = 10501, -- Storage
items = {{2160,10}}, -- {ITEM_ID,COUNT}
},
[50004] = { -- Chest Unique ID
chestLevel = xx, -- Player Level
chestStorage = 10502, -- Storage
items = {{2160,25}}, -- {ITEM_ID,COUNT}
},
[50005] = { -- Chest Unique ID
chestLevel = xx, -- Player Level
chestStorage = 10503, -- Storage
items = {{2160,50}} -- {ITEM_ID,COUNT}
},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local questStatus = getPlayerStorageValue(cid, CONFIG[item.uid].chestStorage)
if (questStatus == -1) then
if getPlayerLevel(cid) >= CONFIG[item.uid].chestLevel then
for i = 1, #CONFIG[item.uid].items do
doPlayerAddItem(cid, CONFIG[item.uid].items[1], CONFIG[item.uid].items[2])
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! Now you can buy some staff")
doSendAnimatedText(getCreaturePosition(cid), "Success!", TEXTCOLOR_RED)
setPlayerStorageValue(cid, CONFIG[item.uid].chestStorage, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be atleast level ".. CONFIG[item.uid].chestLevel.." to open this chest.")
end
else
doSendAnimatedText(fromPosition, "Empty", TEXTCOLOR_WHITE)
end
return true
end
and its working fine, but now i using older version of TFS with is not supporting local config. Is there anybody who can rebuild this script?
Oh and i search on forum something helpful but nothing found.
Thanks for helping!