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

Help with Inq Script

Gutolp001

New Member
Joined
Aug 3, 2017
Messages
7
Reaction score
0
TFS 0.4 protocol 8.6
Good night friends. I would like some help to make a part of this quest script, what I need is to check the storage 39000 value 7 so that the player cannot repeat the same action (complete te quest again). I thank you all.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local tilepos5 = {x=33115, y=31702, z=12}
local tilepos3 = {x=33114, y=31700, z=12}
local tilepos4 = {x=33115, y=31700, z=12}
local tilepos6 = {x=33116, y=31700, z=12}
local tilepos7 = {x=33114, y=31701, z=12}
local tilepos8 = {x=33115, y=31701, z=12}
local tilepos9 = {x=33116, y=31701, z=12}

if(itemEx.uid == 6669) and (itemEx.itemid == 8759) then
if getPlayerStorageValue(cid, 1996) == 1 then
doPlayerRemoveItem(cid, 7494, 1)
doSendMagicEffect(tilepos5,15)
doSendMagicEffect(tilepos3,5)
doSendMagicEffect(tilepos4,5)
doSendMagicEffect(tilepos6,5)
doSendMagicEffect(tilepos7,5)
doSendMagicEffect(tilepos8,5)
doSendMagicEffect(tilepos9,5)
setPlayerStorageValue(cid, 39000, 7)
doCreatureSay(cid, 'Você destruiu com sucesso o Shadow Nexus!', TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid,22,"Seu Questlog foi atualizado!")
else
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "message to cancel")
end
return TRUE
end
end
 
Just change
Lua:
if getPlayerStorageValue(cid, 1996) == 1
to
Lua:
if getPlayerStorageValue(cid, 1996) == 1 and not getPlayerStorageValue(cid,39000) >= 7
 
Hello friend, thank you for reply. Is presenting the following error in distro.
Lua:
[9:7:43.070] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/vulcan/inquisition/nexus.lua)
[9:7:43.085] data/actions/scripts/vulcan/inquisition/nexus.lua:13: 'then' expected near 'doPlayerRemoveItem'
 
You removed then when replace if lines, add it like this
Lua:
if getPlayerStorageValue(cid, 1996) == 1 and not getPlayerStorageValue(cid,39000) >= 7 then
 
When i use the object, this error apear in distro. Sorry for my bad english.

Lua:
[9:17:49.066] [Error - Action Interface]
[9:17:49.066] data/actions/scripts/vulcan/inquisition/nexus.lua:onUse
[9:17:49.066] Description:
[9:17:49.066] data/actions/scripts/vulcan/inquisition/nexus.lua:12: attempt to compare number with boolean
[9:17:49.066] stack traceback:
[9:17:49.082]   data/actions/scripts/vulcan/inquisition/nexus.lua:12: in function <data/actions/scripts/vulcan/inquisition/nexus.lua:1>
 
Try this
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local tilepos5 = {x=33115, y=31702, z=12}
local tilepos3 = {x=33114, y=31700, z=12}
local tilepos4 = {x=33115, y=31700, z=12}
local tilepos6 = {x=33116, y=31700, z=12}
local tilepos7 = {x=33114, y=31701, z=12}
local tilepos8 = {x=33115, y=31701, z=12}
local tilepos9 = {x=33116, y=31701, z=12}

if(itemEx.uid == 6669) and (itemEx.itemid == 8759) then
if (getPlayerStorageValue(cid, 1996) == 1) and not (getPlayerStorageValue(cid,39000) >= 7) then
doPlayerRemoveItem(cid, 7494, 1)
doSendMagicEffect(tilepos5,15)
doSendMagicEffect(tilepos3,5)
doSendMagicEffect(tilepos4,5)
doSendMagicEffect(tilepos6,5)
doSendMagicEffect(tilepos7,5)
doSendMagicEffect(tilepos8,5)
doSendMagicEffect(tilepos9,5)
setPlayerStorageValue(cid, 39000, 7)
doCreatureSay(cid, 'Você destruiu com sucesso o Shadow Nexus!', TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid,22,"Seu Questlog foi atualizado!")
else
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "message to cancel")
end
return TRUE
end
end
 
It worked perfectly, but even if the player doesn’t have item 7494 he can complete the quest normally, he could put a check on the item and if he doesn’t have it on bp send a cancellation message ?
Thanks for helping me with the first problem
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local tilepos5 = {x=33115, y=31702, z=12}
local tilepos3 = {x=33114, y=31700, z=12}
local tilepos4 = {x=33115, y=31700, z=12}
local tilepos6 = {x=33116, y=31700, z=12}
local tilepos7 = {x=33114, y=31701, z=12}
local tilepos8 = {x=33115, y=31701, z=12}
local tilepos9 = {x=33116, y=31701, z=12}

if(itemEx.uid == 6669) and (itemEx.itemid == 8759) then
if (getPlayerStorageValue(cid, 1996) == 1) and not (getPlayerStorageValue(cid,39000) >= 7) and (doPlayerRemoveItem(cid,7494,1) == TRUE) then
doPlayerRemoveItem(cid, 7494, 1)
doSendMagicEffect(tilepos5,15)
doSendMagicEffect(tilepos3,5)
doSendMagicEffect(tilepos4,5)
doSendMagicEffect(tilepos6,5)
doSendMagicEffect(tilepos7,5)
doSendMagicEffect(tilepos8,5)
doSendMagicEffect(tilepos9,5)
setPlayerStorageValue(cid, 39000, 7)
doCreatureSay(cid, 'Você destruiu com sucesso o Shadow Nexus!', TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid,22,"Seu Questlog foi atualizado!")
else
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "message to cancel")
end
return TRUE
end
end
 
It worked, but it is returnig the first cancellation message. I would like to send a new cancellation message if he doesn't have the item on bp .
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local tilepos5 = {x=33115, y=31702, z=12}
local tilepos3 = {x=33114, y=31700, z=12}
local tilepos4 = {x=33115, y=31700, z=12}
local tilepos6 = {x=33116, y=31700, z=12}
local tilepos7 = {x=33114, y=31701, z=12}
local tilepos8 = {x=33115, y=31701, z=12}
local tilepos9 = {x=33116, y=31701, z=12}

if(itemEx.uid == 6669) and (itemEx.itemid == 8759) then
if (getPlayerStorageValue(cid, 1996) == 1) and not (getPlayerStorageValue(cid,39000) >= 7) then
if doPlayerRemoveItem(cid,7494,1) == TRUE then
doPlayerRemoveItem(cid, 7494, 1)
doSendMagicEffect(tilepos5,15)
doSendMagicEffect(tilepos3,5)
doSendMagicEffect(tilepos4,5)
doSendMagicEffect(tilepos6,5)
doSendMagicEffect(tilepos7,5)
doSendMagicEffect(tilepos8,5)
doSendMagicEffect(tilepos9,5)
setPlayerStorageValue(cid, 39000, 7)
doCreatureSay(cid, 'Você destruiu com sucesso o Shadow Nexus!', TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid,22,"Seu Questlog foi atualizado!")
else
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "message to cancel")
end
else
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You do not have the required item.")
end
return TRUE
end
end
 
Last edited:
Back
Top