• 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 Not Work

mocoba

New Member
Joined
Aug 23, 2008
Messages
332
Reaction score
0
Hello Guys
when i put this scrip i made it the first chest only work but another 4 chests not work it open like box please help me guys
PHP:
function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 59939 then
   		queststatus = getPlayerStorageValue(cid,59982)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a Chain bolter.")
   			doPlayerAddItem(cid,8850,1)
   			setPlayerStorageValue(cid,59982,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 59938 then
   		queststatus = getPlayerStorageValue(cid,59982)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a Bloody edge .")
   			doPlayerAddItem(cid,7416,1)
   			setPlayerStorageValue(cid,59982,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 59937 then
   		queststatus = getPlayerStorageValue(cid,59982)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a demonwing axe .")
   			doPlayerAddItem(cid,8926,1)
   			setPlayerStorageValue(cid,59982,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
     elseif item.uid == 59936 then
   		queststatus = getPlayerStorageValue(cid,59982)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a bonebreaker.")
   			doPlayerAddItem(cid,7428,1)
   			setPlayerStorageValue(cid,59982,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
end
     elseif item.uid == 59935 then
   		queststatus = getPlayerStorageValue(cid,59982)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a Ducks Wand.")
   			doPlayerAddItem(cid,7410,1)
   			setPlayerStorageValue(cid,59982,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end
 
It's because all of them uses storage 59982, try this:

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

       if item.uid == 59939 then 
           queststatus = getPlayerStorageValue(cid,59939) 
           if queststatus == -1 then 
               doPlayerSendTextMessage(cid,22,"You have found a Chain bolter.") 
               doPlayerAddItem(cid,8850,1) 
               setPlayerStorageValue(cid,59939,1) 
           else 
               doPlayerSendTextMessage(cid,22,"It is empty.") 
           end 
       elseif item.uid == 59938 then 
           queststatus = getPlayerStorageValue(cid,59938) 
           if queststatus == -1 then 
               doPlayerSendTextMessage(cid,22,"You have found a Bloody edge .") 
               doPlayerAddItem(cid,7416,1) 
               setPlayerStorageValue(cid,59938,1) 
           else 
               doPlayerSendTextMessage(cid,22,"It is empty.") 
           end 
       elseif item.uid == 59937 then 
           queststatus = getPlayerStorageValue(cid,59937) 
           if queststatus == -1 then 
               doPlayerSendTextMessage(cid,22,"You have found a demonwing axe .") 
               doPlayerAddItem(cid,8926,1) 
               setPlayerStorageValue(cid,59937,1) 
           else 
               doPlayerSendTextMessage(cid,22,"It is empty.") 
           end 
     elseif item.uid == 59936 then 
           queststatus = getPlayerStorageValue(cid,59936) 
           if queststatus == -1 then 
               doPlayerSendTextMessage(cid,22,"You have found a bonebreaker.") 
               doPlayerAddItem(cid,7428,1) 
               setPlayerStorageValue(cid,59936,1) 
           else 
               doPlayerSendTextMessage(cid,22,"It is empty.") 
end 
     elseif item.uid == 59935 then 
           queststatus = getPlayerStorageValue(cid,59935) 
           if queststatus == -1 then 
               doPlayerSendTextMessage(cid,22,"You have found a Ducks Wand.") 
               doPlayerAddItem(cid,7410,1) 
               setPlayerStorageValue(cid,59935,1) 
           else 
               doPlayerSendTextMessage(cid,22,"It is empty.") 
           end 
    else 
        return 0 
       end 

       return 1 
end
 
Back
Top