• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

{request} fix my vocation loot quest

Jgarder

Tprogramming Ex-Adm|n
Premium User
Joined
Jun 7, 2007
Messages
355
Reaction score
3
Location
Michigan
I made this script so people could only get the loot for their Vocation, i havnt put in what the loot is.. but its throwing a easy error that i cant figure out. ;) here it is.. please fix it men, i know you guys know what your doing

Code:
-- Newvocquest

function onUse(cid, item, frompos, item2, topos)

   
	if item.uid == 17200 then
		queststatus = getPlayerStorageValue(cid,17200)
		if (getPlayerVocation(cid) == 3) then
   		
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a paladin set")
   			doPlayerAddItem(cid,2152,35)
   			setPlayerStorageValue(cid,17200,1)
   		else
   			doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
   		end
	elseif item.uid == 17201 then
		queststatus = getPlayerStorageValue(cid,17201)
	if (getPlayerVocation(cid) == 4) then
   		
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found A Knight Set.")
   			doPlayerAddItem(cid,2445,35)
   			setPlayerStorageValue(cid,17201,1)
   		else
   			doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
   		end
	elseif item.uid == 17202 then
		queststatus = getPlayerStorageValue(cid,17202)
	if (getPlayerVocation(cid) == 2) then
   		
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found A Druid Set.")
   			doPlayerAddItem(cid,2445,35)
   			setPlayerStorageValue(cid,17202,1)
   		else
   			doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
   		end
	elseif item.uid == 17203 then
		queststatus = getPlayerStorageValue(cid,17203)
	if (getPlayerVocation(cid) == 1) then
   		
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found A Sorcerer Set.")
   			doPlayerAddItem(cid,2445,35)
   			setPlayerStorageValue(cid,17203,1)
   		else
   			doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
   		end

	else
		return 0
   	end

   	return 1
end

This is the error i get
Code:
Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/NV
Q.lua
data/actions/scripts/quests/NVQ.lua:8: 'then' expected near 'queststatus'
Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/NV
Q.lua
data/actions/scripts/quests/NVQ.lua:8: 'then' expected near 'queststatus'
Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/NV
Q.lua
data/actions/scripts/quests/NVQ.lua:8: 'then' expected near 'queststatus'
Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/NV
Q.lua
data/actions/scripts/quests/NVQ.lua:8: 'then' expected near 'queststatus'
 
function onUse(cid, item, frompos, item2, topos)


if item.uid == 17200 then
queststatus = getPlayerStorageValue(cid,17200)
if getPlayerVocation(cid) == 3 then

if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a paladin set")
doPlayerAddItem(cid,2152,35)
setPlayerStorageValue(cid,17200,1)
else
doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
end
elseif item.uid == 17201 then
queststatus = getPlayerStorageValue(cid,17201)
if getPlayerVocation(cid) == 4 then

if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found A Knight Set.")
doPlayerAddItem(cid,2445,35)
setPlayerStorageValue(cid,17201,1)
else
doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
end
elseif item.uid == 17202 then
queststatus = getPlayerStorageValue(cid,17202)
if getPlayerVocation(cid) == 2 then

if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found A Druid Set.")
doPlayerAddItem(cid,2445,35)
setPlayerStorageValue(cid,17202,1)
else
doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
end
elseif item.uid == 17203 then
queststatus = getPlayerStorageValue(cid,17203)
if getPlayerVocation(cid) == 1 then

if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found A Sorcerer Set.")
doPlayerAddItem(cid,2445,35)
setPlayerStorageValue(cid,17203,1)
else
doPlayerSendTextMessage(cid,22,"You already have chosen your vocation set")
end

else
return 0
end

return 1
end




try now i think should work now i dont have test it
 
You are using TFS?

If yes, just try change head of your script:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
Last edited:
Back
Top