Hello here it is another of my simple scripts, NOTE: I AM LEARNING LUA, PLEASE CORRECT ME IF I DID IT BAD.
XML
Comment!
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 212121 then
queststatus = getPlayerStorageValue(cid,212121)
if queststatus == -1 and getPlayerLevel(cid) >= 50 then -- if is more than level 50
doPlayerSendTextMessage(cid,22,"Here is your reward!")
doPlayerAddItem(cid,2160,2) -- edit item id 2160 to your item you want to give reaching this level.
setPlayerStorageValue(cid,212121,1)
else
doPlayerSendCancel(cid,"It is empty or you don't have enough level.")
end
return TRUE
end
XML
Lua:
<action actionid="212121." event="script" value="rewardchest.lua"/>