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

Problem with quests

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
hi, I have a problem in my server that when I try to use a chest that have a quest the player crash(not the server) and I have to put tibia again and enter the password and the player that has the item of the quest but I dont know why it crash. I use actionID because I want that only knights use that chest and I change it to UniqueID and is the same problem. Please someone could help me =)

REP!!
 
its not "the script" is all of the scripts but this is an example:

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


	if item.uid == 1213 then
	        if isKnight(cid) then
 		                queststatus = getPlayerStorageValue(cid,1213)
 		                if queststatus == -1 then
 				       doPlayerSendTextMessage(cid,22,"You have found a Jagged sword")
 				       doPlayerAddItem(cid,8602,1)
       		 	               setPlayerStorageValue(cid,1213,1)
 				else
 				doPlayerSendTextMessage(cid,22,"It is empty.")
 				end
		else
		doPlayerSendTextMessage(cid,22,"You don't have the right vocation.")
		end
	else
	return 0
	end

return 1
end

im using tfs 0.2.11
 
I'm not quite used to 0.2 any longer. Could it be caused by old return method?

Lua:
else
	return 0
	end

return 1
end

make it:
Lua:
else
	return false
	end

return true
end

And why are you having return 0 (or false) at all in the script?
The next line will return true. D:

By not having a return method (or false?) on your script, you will launch the script from top to bot through the cycles in the script, and continue on the default action.

(Meaning a quest script without return true would end up with script running + you open the chest in-game as you would without any script attached to it.

Another sample I use:
When I climb up a ladder (ladder on tibia, get to next floor), I have a single script assigned that every time I click a ladder a storage value will increase. By making a simple onUse script I make storage increment.
But at the end of the script, instead of having "return true" I have either return false, or no return at all. Resulting in that my custom storage value script will continue to launch, AND the default tibia action will launch. (You will climb up 1 floor, as taking stairs normally will, but I did not code this).

Also if the client is the only thing that crashes. And console shows no debugs. It could be text message type number 22 that dosnt exist in the tibia client any longer. Tibia client does not recognize the text type package thus gives us a debug.

What is the error report you get when opening the tibia client again? (The one you usually DONT send to cipsoft, but always asks you to do).
 
Last edited:
You just want new players in temple to pick up a reward? Just do chest put action id 2000, and make a uid. They can use that chest 1x time. And you can do a sign "Knight weapon" or something. But everyone can use that chest.
 
Try either using a lower number than 22, or try to use the name instead of number.
doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, "You have found a Jagged sword")

Also give us the error output you get from tibia client. What is your distro? TFS 0.2, 0.3, 0.4? client version?
 
Try either using a lower number than 22, or try to use the name instead of number.
doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, "You have found a Jagged sword")

Also give us the error output you get from tibia client. What is your distro? TFS 0.2, 0.3, 0.4? client version?

+ rep. ty znote it worked peerfect. i changed from 25 to 19. i chose 19 randomly. (is age to drink and gamble in canada).. thnx mehn <3
 
Back
Top