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

Lua Simple quest problem;

sestorme

Member
Joined
Dec 9, 2011
Messages
272
Reaction score
6
Location
Birmingham, UK
According to few tutorials with action and unique ID's mine don't work since my black contents blocks don't show up; http://otland.net/f479/how-quests-148708/

Code:
function onUse(cid, item, frompos, item2, topos)
local storage = specialQuests[item.actionid]
queststatus = getPlayerStorageValue(cid, 9943)
if storage == 2222 and queststatus =< 1 then
doPlayerAddItem(cid, 2420, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a machete.")
doPlayerSetStorageValue(cid, 9943, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nothing here.")
end
return 1
end

this one don't work either, game can't register special quests.
 
Well you have to as the tutorial says, put:

Code:
local specialQuests = {
	[2001] = 30015 --Annihilator
}

in data/actions/quests/system.lua.
And why the black squares doesn't show up is probably because you have the wrong chest that can't contain anything, or you don't have Remere's Mapeditor. Or maybe it's a bug :p

[EDIT]: It depends on your server version too.
 
Code:
function onUse(cid, item, frompos, item2, topos)
local specialQuests = {
	[2222] = 30015 
}
local storage = specialQuests[item.actionid]

local queststatus = getPlayerStorageValue(cid, 9943)
if storage == 2222 then
if queststatus == 1 then
doPlayerAddItem(cid, 2420, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a machete.")
doPlayerSetStorageValue(cid, 9943, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nothing here.")
end
end
return 1
end

This don't work either.

I have latest 2.1 Remere.
 
Last edited:
LUA:
local t = {
	[1000] = {2420, 1, 9943}, -- [item action id] = {itemId, count, storage} --
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.actionid]
	if(k and getPlayerStorageValue(cid, t[3]) < 1) then
		setPlayerStorageValue(cid, t[3], 1)
		doPlayerAddItem(cid, t[1], t[2] or 1)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a " .. getItemInfo(t[1]).name .. ".")
	else
		doPlayerSendCancel(cid, "It is empty.")
	end
	return true
end
 
Back
Top