Hello everybody
I'm going to share my Vocation Chest now with you all
and put this into actions.xml
I hope it works for all, if not leave a msg with the error code
yours Evil Hero,
I'm going to share my Vocation Chest now with you all
PHP:
-->>>>>>>>>>>>>>>>>++<<<<<<<<<<<<<<<<<<<--
-->>>>>>>>>> Vocation Chest <<<<<<<<<<--
-->>>>>>>>>>>>> made by <<<<<<<<<<<<<<--
-->>>>>>>>>>>> Evil Hero <<<<<<<<<<<<<--
-->>>>>>>>>>>>>>>>>++<<<<<<<<<<<<<<<<<<<--
function onUse(cid, item, frompos, item2, topos)
-->>>>>>>>>> CONFIG <<<<<<<<<<--
local action = xxxx--The id of the Chest
local sorcreward = xxxx--Itemid of the item which will the Sorcerer gain
local druidreward = xxxx--Itemid of the item which will the Druid gain
local paladinreward = xxxx--Itemid of the item which will the Paladin gain
local knightreward = xxxx--Itemid of the item which will the Knight gain
-->>>>>>>>>> /CONFIG <<<<<<<<<<--
-->>>>>>>>>> DO NOT EDIT! <<<<<<<<<<--
local vocation = getCreatureVocation(cid)
local sorcerer = 1
local druid = 2
local paladin = 3
local knight = 4
local mastersorcerer = 5
local elderdruid = 6
local royalpaladin = 7
local eliteknight = 8
-->>>>>>>>>> /DO NOT EDIT! <<<<<<<<<<--
if item.actionid == action then
if getPlayerStorageValue(cid,action) == -1 then
if vocation == sorcerer or vocation == mastersorcerer then
doPlayerAddItem(cid,sorcreward)
doPlayerSendTextMessage(cid,25, "You have found a ".. getItemName(sorcreward) ..".")
setPlayerStorageValue(cid,action,1)
end
else
doPlayerSendCancel(cid,"You already got your reward!")
end
elseif item.actionid == action then
if getPlayerStorageValue(cid,action) == -1 then
if vocation == druid or vocation == elderdruid then
doPlayerAddItem(cid,druidreward)
doPlayerSendTextMessage(cid,25, "You have found a ".. getItemName(druidreward) ..".")
setPlayerStorageValue(cid,action,1)
end
else
doPlayerSendCancel(cid,"You already got your reward!")
end
elseif item.actionid == action then
if getPlayerStorageValue(cid,action) == -1 then
if vocation == paladin or vocation == royalpaladin then
doPlayerAddItem(cid,paladinreward)
doPlayerSendTextMessage(cid,25, "You have found a ".. getItemName(paladinreward) ..".")
setPlayerStorageValue(cid,action,1)
end
else
doPlayerSendCancel(cid,"You already got your reward!")
end
elseif item.actionid == action then
if getPlayerStorageValue(cid,action) == -1 then
if vocation == knight or vocation == eliteknight then
doPlayerAddItem(cid,knightreward)
doPlayerSendTextMessage(cid,25, "You have found a ".. getItemName(knightreward) ..".")
setPlayerStorageValue(cid,action,1)
end
else
doPlayerSendCancel(cid,"You already got your reward!")
end
end
end
and put this into actions.xml
PHP:
<action actionid="THEACTIONIDHERE" script="scriptname.lua" />
I hope it works for all, if not leave a msg with the error code
yours Evil Hero,
Last edited: