• 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 Bug - poi reward

butynhuuw

New Member
Joined
Nov 28, 2009
Messages
51
Reaction score
1
Hey guys, a friend of mine has a bug in his POI...

He can get all the 3 items (arbalest, arcane staff and avenger), and not only one.

Here is the script:

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

	if item.uid == 10544 then
if getPlayerStorageValue(cid,10544) == -1 then
 	doPlayerSendTextMessage(cid,25,"You have chosen an arcane staff.")
 	doPlayerAddItem(cid,2453,1)
 	setPlayerStorageValue(cid,10544,1)
 else
 	doPlayerSendTextMessage(cid,25,"It is empty.")
 end
 
	elseif item.uid == 10545 then
if getPlayerStorageValue(cid,10544) == -1 then
 	doPlayerSendTextMessage(cid,25,"You have chosen the avenger.")
 	doPlayerAddItem(cid,6528,1)
 	setPlayerStorageValue(cid,10544,1)
 else
 	doPlayerSendTextMessage(cid,25,"It is empty.")
 end
 
 	elseif item.uid == 10546 then
if getPlayerStorageValue(cid,10544) == -1 then
 	doPlayerSendTextMessage(cid,25,"You have chosen an arbalest.")
 	doPlayerAddItem(cid,5803,1)
 	setPlayerStorageValue(cid,10544,1)
 else
 	doPlayerSendTextMessage(cid,25,"It is empty.")
 end

The uniqueids are correct, I checked the chests in-game.

In my server I got the same script and the same uniqueids on chests but it works perfectly.

Can anybody help? :)
 
Code:
function onUse(cid, item, frompos, item2, topos)

if item.uid == 10544 then
        if getPlayerStorageValue(cid,10544) == -1 then
 	     doPlayerSendTextMessage(cid,25,"You have chosen an arcane staff.")
    	     doPlayerAddItem(cid,2453,1)
 	     setPlayerStorageValue(cid,10544,1)
             return TRUE
        else
 	     doPlayerSendTextMessage(cid,25,"It is empty.")
             return FALSE
        end
 
elseif item.uid == 10545 then
       if getPlayerStorageValue(cid,10544) == -1 then
 	     doPlayerSendTextMessage(cid,25,"You have chosen the avenger.")
       	     doPlayerAddItem(cid,6528,1)
 	     setPlayerStorageValue(cid,10544,1)
             return TRUE
       else
 	     doPlayerSendTextMessage(cid,25,"It is empty.")
             return FALSE
       end
 
elseif item.uid == 10546 then
       if getPlayerStorageValue(cid,10544) == -1 then
 	     doPlayerSendTextMessage(cid,25,"You have chosen an arbalest.")
 	     doPlayerAddItem(cid,5803,1)
 	     setPlayerStorageValue(cid,10544,1)
             return TRUE
       else
 	     doPlayerSendTextMessage(cid,25,"It is empty.")
             return FALSE
       end
end
return TRUE
end

tidied up a bit, also added the missing END from the bottom ;)
 
I'll try that then I post here :D
thanks
P.s.: it does not have the missing end cause it's just a piece of the script, it's not the full script xDDD
ty man I'll try that and say if worked :D
 
just use normal system.

Action id = 2000
Unique id= same on the three chests.

and put the item u want in the chest in RME ;o
 
Back
Top