Hello users of otland.net, due to the fact that it does little between in this Open Tibia's world Server, me dedicated to trying to try and editing scripts basic, due to this, this one is the first one that I have just edited, it was in the folder of actions there died without use ... and it looks not because I wanted to edit it and now I bring it here in order that you think and criticize in order that I could learn little more on .lua.
Sincerily,
Kaskitin.
Sincerily,
Kaskitin.
Code:
-- Edited First Script by Kaskitin
local config =
(
storage = 51447
accept = "Your have found !ITEM NAME!."
empty = "the chest was empty."
)
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,config.storage)
if queststatus <= -1 then
doPlayerSendTextMessage(cid,22,config.accept)
doPlayerAddItem(cid,config.item,1)
setPlayerStorageValue(cid,config.storage,1)
else
doPlayerSendTextMessage(cid,22,config.empty)
end
return 0
end
return 1
end