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

Problem making a quest

CheatsBCN

New Member
Joined
Mar 6, 2012
Messages
131
Reaction score
1
Hello, I've been trying to make a quests and i've been facing same bug again and again. I added a chest with id 1740 on RME map, i added a UNIQUEID value 1000, actionid i put 0 and 2000(tryed both forms)then i went to the actions.xml and added
PHP:
<action uniqueid="1000" script="quests/test.lua" />

then on test.lua i added this script.

PHP:
function onUse(cid, item, frompos, item2, topos)
  	if item.uid == 1000 then
  		queststatus = getPlayerStorageValue(cid,1000)
  		if queststatus == -1 then
  			if getPlayerLevel(cid) >= 50 then
  				doPlayerSendTextMessage(cid,22,"You have found a Piece of a broken amulet.")
  				doPlayerAddItem(cid,8262,1)
  				setPlayerStorageValue(cid,1000,1)
  			else
  				doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
  			end
  		else
  			doPlayerSendTextMessage(cid,22,"It is empty.")
  		end
  	end
end

and i get a bug and tibia closes autmatically. Weird thing is taht when i open again tibia and log on my character i got the item on my backpack.


WOuld be nice if some1 helps me fast so i can continue finishing my ot. thanks in advance
 
What is the error message in console?
LUA:
function onUse(cid, item, frompos, item2, topos)
	queststatus = getPlayerStorageValue(cid,1000)
	if queststatus == -1 then
		if getPlayerLevel(cid) >= 50 then
			doPlayerSendTextMessage(cid,22,"You have found a Piece of a broken amulet.")
			doPlayerAddItem(cid,8262,1)
			setPlayerStorageValue(cid,1000,1)
		else
			doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
		end
	else
		doPlayerSendTextMessage(cid,22,"It is empty.")
	end
	return true
end
 
Back
Top