• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Chest problem.

mbruzaca

New Member
Joined
Jun 8, 2012
Messages
93
Reaction score
1
Location
Brazil
Hello guys, I just created a new quest in my server and I'm having a little problem, the chest gives me the item, but its also openning it!

take a look!

look.jpg

actions.xml

Code:
<action actionid="55663" event="script" value="quests/dsl_chest.lua" />

dsl_chest.lua

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
       if item.actionid == 55663 then				
			if getPlayerStorageValue(cid, 55661) == -1 then			
				reward = doPlayerAddItem(cid,2469,1)
				setPlayerStorageValue(cid,55661,1)
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You have found a ' .. getItemName(getThing(reward).uid) .. '.')			
			else			
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")			
			end	
		end
end

the chest
Code:
05:19 You see a chest (Vol:15).
ItemID: [1740], ActionID: [55663], UniqueID: [55663].
Position: [X: 32116] [Y: 32121] [Z: 15].


Any idea of what's wrong?


Thanks!

- - - Updated - - -

That problem happens only with that my new chest.. all other chests work perfectly.
 
Last edited:
Hello guys, I just created a new quest in my server and I'm having a little problem, the chest gives me the item, but its also openning it!

take a look!

View attachment 15828

actions.xml

Code:
<action actionid="55663" event="script" value="quests/dsl_chest.lua" />

dsl_chest.lua

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
       if item.actionid == 55663 then				
			if getPlayerStorageValue(cid, 55661) == -1 then			
				reward = doPlayerAddItem(cid,2469,1)
				setPlayerStorageValue(cid,55661,1)
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You have found a ' .. getItemName(getThing(reward).uid) .. '.')			
			else			
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")			
			end	
		end
end

the chest
Code:
05:19 You see a chest (Vol:15).
ItemID: [1740], ActionID: [55663], UniqueID: [55663].
Position: [X: 32116] [Y: 32121] [Z: 15].


Any idea of what's wrong?


Thanks!

- - - Updated - - -

That problem happens only with that my new chest.. all other chests work perfectly.

Maybe it is because you are not returning the script, try this:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
       if item.actionid == 55663 then				
			if getPlayerStorageValue(cid, 55661) == -1 then			
				reward = doPlayerAddItem(cid,2469,1)
				setPlayerStorageValue(cid,55661,1)
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You have found a ' .. getItemName(getThing(reward).uid) .. '.')			
			else			
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")			
			end	
		end
         return TRUE
end
 
Back
Top