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

Arena Mortal Combat

Kojiiro

Nobody cares. Do yourself.
Joined
May 10, 2010
Messages
534
Reaction score
9
Location
Brazil
Well guys, to a problem with my arena zao, the player will be teleported it
to this arena are not summoning the creatures that are in the script can someone
help me?


ERROR:
[Error - Action Interface]
data/actions/scripts/ZaoQuest/zao arena 3.lua:onUse
Description:
(luaGetThingFromPos) Tile not found

[Error - Action Interface]
data/actions/scripts/ZaoQuest/zao arena 3.lua:onUse
Description:
(luaGetThingFromPos) Tile not found

[Error - Action Interface]
data/actions/scripts/ZaoQuest/zao arena 3.lua:onUse
Description:
(luaGetThingFromPos) Tile not found

[Error - Action Interface]
data/actions/scripts/ZaoQuest/zao arena 3.lua:onUse
Description:
(luaDoCreateMonster) Cannot create monster: Baron Brute

[Error - Action Interface]
data/actions/scripts/ZaoQuest/zao arena 3.lua:onUse
Description:
(luaDoCreateMonster) Cannot create monster: The Axeorcist


SCRIPT:
local room = { -- room with demons
fromX = 33053,
fromY = 31025,
fromZ = 3,

toX = 33074,
toY = 31045,
toZ = 3
}

local monster_pos = {
[1] = {pos = {33219, 31657, 3}, monster = "Baron Brute"},
[2] = {pos = {33224, 31659, 3}, monster = "The Axeorcist"}
}

local players_pos = {
{x = 33080, y =31014, z = 2, stackpos = 253},
{x = 33081, y =31014, z = 2, stackpos = 253}
}

local new_player_pos = {
{x = 33055, y = 31034, z = 3},
{x = 33055, y = 31035, z = 3}
}

local playersOnly = "yes"
local questLevel = 120

function onUse(cid, item, fromPosition, itemEx, toPosition)
local all_ready, monsters, player, level = 0, 0, {}, 0
if item.itemid == 1945 then
for i = 1, #players_pos do
table.insert(player, 0)
end
for i = 1, #players_pos do
player = getThingfromPos(players_pos)
if player.itemid > 0 then
if string.lower(playersOnly) == "no" then
if isPlayer(player.uid) == TRUE then
all_ready = all_ready+1
else
monsters = monsters+1
end
else
all_ready = all_ready+1
end
end
end
if all_ready == #players_pos then
for i = 1, #players_pos do
player = getThingfromPos(players_pos)
if isPlayer(player.uid) == TRUE then
if getPlayerLevel(player.uid) >= questLevel then
level = level+1
end
else
level = level+1
end
end
if level == #players_pos then
if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "yes" then
for _, area in pairs(monster_pos) do
doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
end
for i = 1, #players_pos do
doSendMagicEffect(players_pos, CONST_ME_POFF)
doTeleportThing(player.uid, new_player_pos, FALSE)
doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
doTransformItem(item.uid,1946)
end
else
doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
end
else
doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
end
else
doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
end
elseif item.itemid == 1946 then
local player_room = 0
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
if isPlayer(thing.uid) == TRUE then
player_room = player_room+1
end
end
end
end
end
if player_room >= 1 then
doCreatureSay(cid, "There is already a team in the battle room.", TALKTYPE_ORANGE_1)
elseif player_room == 0 then
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
doRemoveCreature(thing.uid)
end
end
end
end
doTransformItem(item.uid,1945)
end
end
return TRUE
end


Hugs Kojiiro:p
 
LUA:
local from = {x=33053, y=31025, z=3}
local to = {x=33074, y=31045, z=3}

local monsters = {
	{{x=33219, y=31657, z=3}, 'Baron Brute'},
	{{x=33224, y=31659, z=3}, 'The Axeorcist'}
}

local players = {
	{{x=33080, y=31014, z=2}, {x=33055, y=31034, z=3}},
	{{x=33081, y=31014, z=2}, {x=33055, y=31035, z=3}}
}

local level = 120

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local t = {}
	if item.itemid == 1945 then
		for i = 1, #players do
			t[i] = getTopCreature(players[i][1]).uid
			if not isPlayer(t[i]) then
				return doCreatureSay(cid, 'You need ' .. #players .. ' players to do this quest.', TALKTYPE_ORANGE_1, false, cid)
			elseif getPlayerLevel(cid) < level then
				return doCreatureSay(cid, 'All players have to be level ' .. level .. ' to do this quest.', TALKTYPE_ORANGE_1, false, cid)
			end
		end
		for i = 1, #t do
			doTeleportThing(t[i], players[i][2])
			doSendMagicEffect(players[i][1], CONST_ME_TELEPORT)
			doSendMagicEffect(players[i][2], CONST_ME_TELEPORT)
		end
		for i = 1, #monsters do
			doCreateMonster(monsters[2], monsters[1])
			doSendMagicEffect(monsters[1], CONST_ME_TELEPORT)
		end
	else
		for x = from.x, to.x do
			for y = from.y, to.y do
				local v = getTopCreature({x=x, y=y, z=from.z}).uid
				if isPlayer(v) then
					return doCreatureSay(cid, 'There is already a team in the battle room.', TALKTYPE_ORANGE_1, false, cid)
				elseif isMonster(v) then
					table.insert(t, v)
				end
			end
		end
		for i = 1, #t do
			doRemoveCreature(t[i])
		end
	end

	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
Check the positions again.
 
Back
Top