• 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!

Lua Quest Problem

muffmo

Learning Lua/Mapper
Joined
Jan 26, 2009
Messages
82
Reaction score
0
Location
sweden
Something's wrong :p
Would be great if someone who got a little more knowlegde could fix it.
Its a quest scripts that will give a different reward to different vocations.
Code:
function onUse(cid, item, frompos, item2, topos)
			 if item.uid == 1112 then
queststatus = getPlayerStorageValue(cid,1111)
if queststatus == -1 and getPlayerVocation(cid) == 1 or 2 then   
   doPlayerSendTextMessage(cid,22,"You have found a Wand of Starstorm.") 
    doPlayerAddItem(cid,8920,1)
     setPlayerStorageValue(cid,1111,1)

elseif queststatus == -1 and getPlayerVocation(cid) == 3 then  
   doPlayerSendTextMessage(cid,22,"You have found a bow and an arrow.") 
    doPlayerAddItem(cid,8858,1)
     doPlayerAddItem(cid,7364,1)
      setPlayerStorageValue(cid,1111,1)

elseif queststatus == -1 and getPlayerVocation(cid) == 4 then  
   doPlayerSendTextMessage(cid,22,"You have found a Solar Blade.") 
    doPlayerAddItem(cid,8931,1)
     setPlayerStorageValue(cid,1111,1)

else
   doPlayerSendTextMessage(cid,22,"You have already chosen your reward.")
end
end
return 1
end

PLixoRR Help ^_^
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local queststatus = getPlayerStorageValue(cid, 1111)
	if item.uid == 1112 then
		if queststatus < 1 then
			if(isSorcerer(cid) == TRUE or isDruid(cid) == TRUE) then   
				doPlayerSendTextMessage(cid, 22, "You have found a wand of starstorm.") 
				doPlayerAddItem(cid, 8920, 1)
				setPlayerStorageValue(cid, 1111, 1)
			elseif isPaladin(cid) == TRUE then
				doPlayerSendTextMessage(cid, 22, "You have found a bow and an arrow.") 
				doPlayerAddItem(cid, 8858, 1)
				doPlayerAddItem(cid, 7364, 1)
				setPlayerStorageValue(cid, 1111, 1)
			elseif isKnight(cid) == TRUE then 
				doPlayerSendTextMessage(cid, 22, "You have found a solar blade.") 
				doPlayerAddItem(cid, 8931, 1)
				setPlayerStorageValue(cid, 1111, 1)
			end
		else
			doPlayerSendTextMessage(cid, 22, "You have already chosen your reward.")
		end
	end
return TRUE
end
 
The error you had was right here:
Code:
if queststatus == -1 and [B][I]getPlayerVocation(cid) == 1 or 2[/I][/B] then

You could've fixed it by making it
Code:
if queststatus == -1 and [B][I]getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2[/I][/B] then
but it wouldn't work for any promoted chars.
The script Hermes posted will work better for you.
 
Last edited:
Back
Top