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

Anhi error

semary

[BB] OTland
Joined
May 3, 2009
Messages
813
Reaction score
18
Location
E G Y P T
Lua:
local config = {
	daily = "no",
	level = 120,
	storage = 30015
	entry =
	{
		{x = 32362, y = 32155, z = 7},
		{x = 32362, y = 32156, z = 7},
		{x = 32362, y = 32157, z = 7},
		{x = 32362, y = 32158, z = 7}
	},
	destination =
	{
		{x = 32354, y = 32125, z = 6},
		{x = 32354, y = 32126, z = 6},
		{x = 32354, y = 32127, z = 6},
		{x = 32354, y = 32128, z = 6}
	}
}

config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 5055) then
		if(config.daily) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		else
			doTransformItem(item.uid, item.itemid - 1)
		end

		return true
	end

	if(item.itemid ~= 5056) then
		return true
	end

	local players = {}
	for _, position in ipairs(config.entry) do
		local pid = getTopCreature(position).uid
		if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			return true
		end

		table.insert(players, pid)
	end

	for i, pid in ipairs(players) do
		doSendMagicEffect(config.entry[i], CONST_ME_POFF)
		doTeleportThing(pid, config.destination[i], false)
		doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
	end

	doTransformItem(item.uid, item.itemid + 1)
	return true
end

Error

Lua:
[05/07/2010 11:19:23] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'
[05/07/2010 11:19:23] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[05/07/2010 11:19:23] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'
 
Lua:
local config = {
        daily = "no",
        level = 120,
        storage = 30015,
        entry =
        {
                {x = 32362, y = 32155, z = 7},
                {x = 32362, y = 32156, z = 7},
                {x = 32362, y = 32157, z = 7},
                {x = 32362, y = 32158, z = 7}
        },

{		
        destination =
        {
                {x = 32354, y = 32125, z = 6},
                {x = 32354, y = 32126, z = 6},
                {x = 32354, y = 32127, z = 6},
                {x = 32354, y = 32128, z = 6}
        }
}


config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 5055) then
                if(config.daily) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        doTransformItem(item.uid, item.itemid - 1)
                end

                return true
        end

        if(item.itemid ~= 5056) then
                return true
        end

        local players = {}
        for _, position in ipairs(config.entry) do
                local pid = getTopCreature(position).uid
                if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                        return true
                end

                table.insert(players, pid)
        end

        for i, pid in ipairs(players) do
                doSendMagicEffect(config.entry[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
        end

        doTransformItem(item.uid, item.itemid + 1)
        return true
end
 
[06/07/2010 03:28:11] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:24: '}' expected (to close '{' at line 1) near 'config'
[06/07/2010 03:28:11] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[06/07/2010 03:28:11] data/actions/scripts/quests/annihilator.lua:24: '}' expected (to close '{' at line 1) near 'config'
 
try it now and tell me errors, if any.
Code:
local config =  {
        daily = "no",
        level = 120,
        storage = 30015,
        entry =
        {
                {x = 32362, y = 32155, z = 7},
                {x = 32362, y = 32156, z = 7},
                {x = 32362, y = 32157, z = 7},
                {x = 32362, y = 32158, z = 7}
        },             
        destination =
        {
                {x = 32354, y = 32125, z = 6},
                {x = 32354, y = 32126, z = 6},
                {x = 32354, y = 32127, z = 6},
                {x = 32354, y = 32128, z = 6}
        }
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 5055) then
                if(config.daily) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        doTransformItem(item.uid, item.itemid - 1)
                end

                return true
        end

        if(item.itemid ~= 5056) then
                return true
        end

        local players = {}
        for _, position in ipairs(config.entry) do
                local pid = getTopCreature(position).uid
                if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                        return true
                end

                table.insert(players, pid)
        end

        for i, pid in ipairs(players) do
                doSendMagicEffect(config.entry[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
        end

        doTransformItem(item.uid, item.itemid + 1)
        return true
end
 
try it now and tell me errors, if any.
Code:
local config =  {
        daily = "no",
        level = 120,
        storage = 30015,
        entry =
        {
                {x = 32362, y = 32155, z = 7},
                {x = 32362, y = 32156, z = 7},
                {x = 32362, y = 32157, z = 7},
                {x = 32362, y = 32158, z = 7}
        },             
        destination =
        {
                {x = 32354, y = 32125, z = 6},
                {x = 32354, y = 32126, z = 6},
                {x = 32354, y = 32127, z = 6},
                {x = 32354, y = 32128, z = 6}
        }
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 5055) then
                if(config.daily) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        doTransformItem(item.uid, item.itemid - 1)
                end

                return true
        end

        if(item.itemid ~= 5056) then
                return true
        end

        local players = {}
        for _, position in ipairs(config.entry) do
                local pid = getTopCreature(position).uid
                if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                        return true
                end

                table.insert(players, pid)
        end

        for i, pid in ipairs(players) do
                doSendMagicEffect(config.entry[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
        end

        doTransformItem(item.uid, item.itemid + 1)
        return true
end

no error

but monky saute disapear and we cant enter
5055 =04:06 You see a stone monkey
Nothing is written on it.
ItemID: [5055].
5056 = 04:06 You see a stone monkey
Nothing is written on it.
ItemID: [5056].
 
I think there is a problem here:
Code:
for i, pid in ipairs(players) do
                doSendMagicEffect(config.entry[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
        end
it can also be the data in the 'table',
does it teleport the players?? if not,
then that's due to the table or the
code i just showed you, I don't know
much about table.insert(how does it
insert its values)
 
Try this and let me know of the errors:
Code:
local config =  {
        daily = "no",
        level = 120,
        storage = 30015,
        entry =
        {
                {x = 32362, y = 32155, z = 7},
                {x = 32362, y = 32156, z = 7},
                {x = 32362, y = 32157, z = 7},
                {x = 32362, y = 32158, z = 7}
        },             
        destination =
        {
                {x = 32354, y = 32125, z = 6},
                {x = 32354, y = 32126, z = 6},
                {x = 32354, y = 32127, z = 6},
                {x = 32354, y = 32128, z = 6}
        }
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 5055) then
                if(config.daily) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        doTransformItem(item.uid, item.itemid - 1)
                end

                return true
        end

        if(item.itemid ~= 5056) then
                return true
        end

        local players = {}
        for _ = 1, #config.entry do
                local pid = getTopCreature(config.entry[_]).uid
                if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
                        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                        return true
                end

                table.insert(players, pid)
        end

        for i, pid in ipairs(players) do
                doSendMagicEffect(config.entry[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
        end

        doTransformItem(item.uid, item.itemid + 1)
        return true
end
 
did the players teleport?? does it give error??
post a screen shot of the place where all this happens
and check this location when you use the script again
x = 32354, y = 32125, z = 6 go to that place with a caracter
and tell me if you see the monkey statue there.
 
Back
Top