Skrypt by **__Moqill__** \\
Licencja: //Nie może się znaleść na innych stronach www. Można sobie skorzytać w silniczku tylko...//\\
Testowane: tfs 0.4_
Pliczek chest.lua
local config = {
[uid] = {storage=ID, item=ID}, -- uid to uniqudeid skrzynki, storage to to co dopisuje się w bazie, item id przedmiotu którym ma otrzymać gracz
[uid] = {storage=ID, item=ID},
[uid] = {storage=ID, item=ID}
}
function onUse(cid, item, frompos, item2, topos)
local cfg=config[item.uid]
if getPlayerStorageValue(cid, cfg.storage) == -1 then
doPlayerSendTextMessage(cid,22,"You have found "..getItemNameById(cfg.item)..".")
doPlayerAddItem(cid,cfg.item,1)
setPlayerStorageValue(cid,cfg.storage,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return true
end
do action.xml dodajemy jedna z linijek do wyboru