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

Solved Chest problem

EvoSoft

Is Da Mapper
Joined
Mar 10, 2010
Messages
693
Reaction score
5
Location
Northen part of Sweden
Hi again!
I've been searching around and only found one script but.. there's an error popping up..
fa6b70c563681ccf8377293f3735c0dc.png

LUA:
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,11171) == -1 then
doPlayerAddItem(cid,1988)
doPlayerAddItem(cid,2457)
doPlayerAddItem(cid,2463)
doPlayerAddItem(cid,2647)
doPlayerAddItem(cid,2525)
doPlayerAddItem(cid,2392)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have collected the Knight Set!")
setPlayerStorageValue(cid,11170,1)
doSendMagicEffect(getPlayerPosition(cid),28)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"The chest is empty.")
end
end
end
end
 
Last edited:
Hi EvoSoft,

There were more 'ends' than 'ifs'.

Anyway, here's an edited version that should work (untested).
Code:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid,11171) == -1 then
		doPlayerAddItem(cid,1988)
		doPlayerAddItem(cid,2457)
		doPlayerAddItem(cid,2463)
		doPlayerAddItem(cid,2647)
		doPlayerAddItem(cid,2525)
		doPlayerAddItem(cid,2392)
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have collected the Knight Set!")
		setPlayerStorageValue(cid,11170,1)
		doSendMagicEffect(getPlayerPosition(cid),28)
	else
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"The chest is empty.")
	end
	return TRUE
end

Cheers,
Yodot.
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid,11171) == -1 then
		doPlayerAddItem(cid,1988)
		doPlayerAddItem(cid,2457)
		doPlayerAddItem(cid,2463)
		doPlayerAddItem(cid,2647)
		doPlayerAddItem(cid,2525)
		doPlayerAddItem(cid,2392)
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have collected the Knight Set!")
		setPlayerStorageValue(cid,11171,1)
		doSendMagicEffect(getPlayerPosition(cid),28)
	else
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"The chest is empty.")
	end
	return true
end

Edit: I was slower :p
But the storage was incorrect too.
LUA:
if getPlayerStorageValue(cid,11171) == -1 then
While setting to different storage
LUA:
setPlayerStorageValue(cid,11170,1)
 
Back
Top