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

error in quest

kamilcioo

Veteran OT User
Joined
Jul 25, 2008
Messages
977
Solutions
1
Reaction score
289
I need help with this script. Dont work!. Help fast. REP++.

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

if item.uid == 40001 then
queststatus1 = getPlayerStorageValue(cid,40001)
if queststatus1 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,7407,1)
setPlayerStorageValue(cid,40001,1)

else if item.uid == 40002 then
queststatus2 = getPlayerStorageValue(cid,40002)
if queststatus2 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,2445,1)
setPlayerStorageValue(cid,40002,1)

else if item.uid == 40003 then
queststatus3 = getPlayerStorageValue(cid,40003)
if queststatus3 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,7456,1)
setPlayerStorageValue(cid,40003,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end





else if item.uid == 41001 then
queststatus4 = getPlayerStorageValue(cid,41001)
if queststatus4 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,9776,1)
setPlayerStorageValue(cid,41001,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 41002 then
queststatus5 = getPlayerStorageValue(cid,41002)
if queststatus5 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,9778,1)
setPlayerStorageValue(cid,41002,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 41003 then
queststatus6 = getPlayerStorageValue(cid,41003)
if queststatus6 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,9777,1)
setPlayerStorageValue(cid,41003,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end





else if item.uid == 42001 then
queststatus7 = getPlayerStorageValue(cid,42001)
if queststatus7 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,6132,1)
setPlayerStorageValue(cid,42001,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end





else if item.uid == 44001 then
queststatus8 = getPlayerStorageValue(cid,44001)
if queststatus8 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,8928,1)
setPlayerStorageValue(cid,44001,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 44002 then
queststatus9 = getPlayerStorageValue(cid,44002)
if queststatus9 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,2390,1)
setPlayerStorageValue(cid,44002,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 44003 then
queststatus10 = getPlayerStorageValue(cid,44003)
if queststatus10 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,8926,1)
setPlayerStorageValue(cid,44003,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 44004 then
queststatus11 = getPlayerStorageValue(cid,44004)
if queststatus11 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,8852,1)
setPlayerStorageValue(cid,44004,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end





else if item.uid == 45001 then
queststatus12 = getPlayerStorageValue(cid,45001)
if queststatus12 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,2469,1)
setPlayerStorageValue(cid,45001,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end







else if item.uid == 43001 then
queststatus13 = getPlayerStorageValue(cid,43001)
if queststatus13 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,10518,1)
setPlayerStorageValue(cid,43001,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

else if item.uid == 43002 then
queststatus14 = getPlayerStorageValue(cid,43002)
if queststatus14 == -1 then
doPlayerSendTextMessage(cid,22,"You have found it!.")
doPlayerAddItem(cid,12623,1)
setPlayerStorageValue(cid,43002,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end


return 0
end
return 1
end
 
Code:
local t = {
[40001] = {1000,7407,"You have found it!.","It is empty."},
[40002] = {1001,2445,"You have found it!.","It is empty."},
[40003] = {1002,7456,"You have found it!.","It is empty."},
[41001] = {1003,7407,"You have found it!.","It is empty."},
[41002] = {1004,9778,"You have found it!.","It is empty."},
[41003] = {1005,9777,"You have found it!.","It is empty."},
[42001] = {1006,6132,"You have found it!.","It is empty."},
[44001] = {1007,8928,"You have found it!.","It is empty."},
[44002] = {1008,2390,"You have found it!.","It is empty."},
[44003] = {1009,8926,"You have found it!.","It is empty."},
[44004] = {1010,8852,"You have found it!.","It is empty."},
[45001] = {1011,2469,"You have found it!.","It is empty."},
[43001] = {1012,10518,"You have found it!.","It is empty."},
[43002] = {1013,12623,"You have found it!.","It is empty."}
}
function onUse(cid,item,frompos,item2,topos)
local v = t[item.uid]
if getPlayerStorageValue(cid,v[1])then
setPlayerStorageValue(cid,v[1],1)
doPlayerAddItem(cid,v[2],1)
doPlayerSendTextMessage(cid,22,v[3])
else
doPlayerSendCancel(cid,v[4])
end
return true
end

actions.xml
Code:
<action uniqueid="40001,40002,40003,41001,41002,41003,42001,44001,44002,44003,44004,45001,43001,43002" event="script" value="quest.lua"/>
 
Last edited:
Lua:
local t = {
	[40001] = 7407,
	[40002] = 2445,
	[40003] = 7456,
	[41001] = 7407,
	[41002] = 9778,
	[41003] = 9777,
	[42001] = 6132,
	[44001] = 8928,
	[44002] = 2390,
	[44003] = 8926,
	[44004] = 8852,
	[45001] = 2469,
	[43001] = 10518,
	[43002] = 12623
}
function onUse(cid,item,fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, item.uid) == -1 then
		local v = t[item.uid]
		doCreatureSetStorage(cid, item.uid, 1)
		doPlayerAddItem(cid, v, 1)
		local k = getItemInfo(v)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found ' .. k.article .. ' ' .. k.name .. '.')
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'The ' .. getItemInfo(item.itemid).name .. ' is empty.')
	end
	return true
end
But i dont get it. Why would you use this instead of TFS quest system? Unless you're using an uncompatible distro, in which case this won't even work.
 
Last edited:
Back
Top