Im trying to do 1 chest that gives a reward depending on vocation but it is giving me "end" errors in console at line 27.
ANNIHILATOR REWARD
Am I missing ends?
If this is any help, here is the base quest I modified:
Thanks in advance.
/zeeb
ANNIHILATOR REWARD
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 2007 then
if getPlayerStorageValue(cid, 2007) == -1 then
if getPlayerVocation(cid) == 1 or 5 then
doPlayerSendTextMessage(cid, 22, "You found the sorcerer reward.")
doPlayerAddItem(cid, ####, 1)
setPlayerStorageValue(cid, 2007, 1)
elseif getPlayerVocation(cid) == 2 or 6 then
doPlayerSendTextMessage(cid, 22, "You found the druid reward.")
doPlayerAddItem(cid, ####, 1)
setPlayerStorageValue(cid, 2007, 1)
elseif getPlayerVocation(cid) == 3 or 7 then
doPlayerSendTextMessage(cid, 22, "You found the paladin reward.")
doPlayerAddItem(cid, ####, 1)
setPlayerStorageValue(cid, 2007, 1)
elseif getPlayerVocation(cid) == 4 or 8 then
doPlayerSendTextMessage(cid, 22, "You found the knight reward.")
doPlayerAddItem(cid, ####, 1)
setPlayerStorageValue(cid, 2007, 1)
else
doPlayerSendTextMessage(cid, 22, "It is empty.")
end
else
return 0
end
return 1
end
Am I missing ends?
If this is any help, here is the base quest I modified:
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 2002 then
if getPlayerStorageValue(cid, 2002) == -1 then
doPlayerSendTextMessage(cid, 22, "You found a heavy machete.")
doPlayerAddItem(cid, 2442, 1)
setPlayerStorageValue(cid, 2002, 1)
else
doPlayerSendTextMessage(cid, 22, "It is empty.")
end
else
return 0
end
return 1
end
Thanks in advance.
/zeeb