Adrenaline
Waiting for God
Hi !
I found this script but dont work? - When click at chest, opens just like a normal chest :|
TFS 0.3.6 - whats wrong with this script :S
THIS IS NOT SHOP. This is items for beginner players
I found this script but dont work? - When click at chest, opens just like a normal chest :|
TFS 0.3.6 - whats wrong with this script :S
THIS IS NOT SHOP. This is items for beginner players
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local chests = {
[20000] = {
items = { {7618,20} },
container = 2000,
storage = 5511,
msg = "You have found a backpack health potions."
},
[20001] = {
items = { {7620,20} },
container = 2001,
storage = 5512,
msg = "You have found a backpack mana potions."
},
[20002] = {
items = { {2160,1}, {2311,100 },
container = 2002,
storage = 5513,
msg = "You have found a backpack with 1 crystal coin and one rune."
},
[20003] = {
items = { {3969,1},{7744,1}, {8910,1}, {8921,1} },
container = 1988,
storage = 5514,
msg = "You have found a beginner items."
},
[20004] = {
items = { {7589,20} },
container = 2001,
storage = 5515,
msg = "You have found a backpack strong mana potions."
},
[20005] = {
items = { {758,20} },
container = 2000,
storage = 5516,
msg = "You have found a backpack strong health potions."
}
}
local bp = doCreateItemEx(chests[item.uid].container, 1)
for i = 1, getContainerCapById(chests[item.uid].container) do
doAddContainerItem(bp, chests[item.uid].items[1], chests[item.uid].items[2])
end
if(doPlayerAddItemEx(cid, bp, 0) == RETURNVALUE_NOERROR) then
if(getPlayerStorageValue(cid, chests[item.uid].storage) == -1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, chests[item.uid].msg)
setPlayerStorageValue(cid, chests[item.uid].storage, 1)
else
doPlayerSendCancel(cid, "You have already received your reward.")
end
else
doPlayerSendCancel(cid, "You do not have enough capacity/space.")
end
return true
end
Last edited: