• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Zao Arena Lever (Solved)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Why does this script don't work? No bugs in console.
I'm using dev0.4, rev3884.
PHP:
	<action uniqueid="45474" event="script" value="Prologue/arenazaolever.lua"/>
LUA:
local t, player = {
	pedestals = {
		{x=33080, y=31014, z=2},
		{x=33081, y=31014, z=2}
	},
	newPos = {
		{x=33059, y=31032, z=3},
		{x=33057, y=31034, z=3}
	},
	area = {
		fromX = 33054, toX = 33073,
		fromY = 31026, toY = 32356,
		z = 3
	},
	storageDone = 4767,
	level = 80
}, {0, 0}
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end
 
	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end
 
function Wave1()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave2, 30 * 1000)
end
 
function Wave2()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT) 
	addEvent(Wave3, 35 * 1000)
end
 
function Wave3()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave4, 40 * 1000)
end
 
function Wave4()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave5, 40 * 1000)
end
 
function Wave5()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave6, 40 * 1000)
end
 
function Wave6()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 33064, y = 31032, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave7, 40 * 1000)
end
 
function Wave7()
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local failed = false
	for i = 1, #t.pedestals do
		player[i] = getTopCreature(t.pedestals[i]).uid
		if(not(player[i] > 0 and isPlayer(player[i]) == TRUE and getPlayerStorageValue(player[i], t.storageDone) < 1 and getPlayerLevel(player[i]) >= t.level)) then
			failed = true
			break
		end
	end
	if not failed then
		if #getCreaturesInRange({x=33063, y=31035,z=3}, 10, 9, FALSE, TRUE) > 0 then
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Some people are already in the arena.")
			return true
		end
		for i = 1, #player do
			doTeleportThing(player[i], t.newPos[i])
		end
		Wave1()
		doTransformItem(item.uid, 1946)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
	end
	return true
end
 
I'm using Dev0.4 - rev3884 too
and it's working fine.

Are you sure that you have set the right positions?

Anyway, here's my files

LUA:
local t, player = {
	pedestals = {
		{x=472, y=143, z=4},
		{x=473, y=143, z=4}
	},
	newPos = {
		{x=451, y=157, z=6},
		{x=451, y=159, z=6}
	},
	area = {
		fromX = 471, toX = 142,
		fromY = 474, toY = 144,
		z = 4
	},
	storageDone = 42436,
	level = 120
}, {0, 0}
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end
 
	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end
 
function Wave1()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x  = 465, y = 164, z = 6})), CONST_ME_TELEPORT)
	addEvent(Wave2, 30 * 1000)
end
 
function Wave2()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x = 465, y = 164, z = 6})), CONST_ME_TELEPORT) 
	addEvent(Wave3, 35 * 1000)
end
 
function Wave3()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 465, y = 164, z = 6})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
	addEvent(Wave4, 40 * 1000)
end
 
function Wave4()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 465, y = 164, z = 6})), CONST_ME_TELEPORT)
	addEvent(Wave5, 40 * 1000)
end
 
function Wave5()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
	addEvent(Wave6, 40 * 1000)
end
 
function Wave6()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 465, y = 164, z = 6})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 465, y = 158, z = 6})), CONST_ME_TELEPORT)
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 465, y = 164, z= 6})), CONST_ME_TELEPORT)
	addEvent(Wave7, 40 * 1000)
end
 
function Wave7()
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 468, y = 158, z = 6})), CONST_ME_TELEPORT)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local failed = false
	for i = 1, #t.pedestals do
		player[i] = getTopCreature(t.pedestals[i]).uid
		if(not(player[i] > 0 and isPlayer(player[i]) == TRUE and getPlayerStorageValue(player[i], t.storageDone) < 1 and getPlayerLevel(player[i]) >= t.level)) then
			failed = true
			break
		end
	end
	if not failed then
		if #getCreaturesInRange({x=460, y=157,z=6}, 10, 9, FALSE, TRUE) > 0 then
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Another Team is fighting in the Arena.")
			return true
		end
		for i = 1, #player do
			doTeleportThing(player[i], t.newPos[i])
		end
		Wave1()
		doTransformItem(item.uid, 1946)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
	end
	return true
end

XML:
	<action uniqueid="32145" event="script" value="Both Sides/Chazorai_Lever.lua"/>
 
U need to configure it with ur map's coordenates....
U can't use Gabriel Tibiano's script, because it's the same like urs but with the coordinates of his map....
Hope u understand me... ^^
 
@LucasOlzon

Your pedestal are something like this? \/ Cause there's an stackpos

getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})

pedestal.png
 
Last edited:
no console erros?

It's probably in the settings of the script
may i help you?

I'll edit a picture for you for you to see, wait a few minutes.

#UPDATE

I think that ur problem is in area config.
Anyway, follow theese steps.

pedestal.png


pedestal2.png



REP ++ ? :D
 
Last edited:
@Cykotitan

does not work!

Code:
local t, player = {
pedestals = {
{x=1153, y=845, z=2},
{x=1154, y=845, z=2}
},
newPos = {
{x=1128, y=865, z=3},
{x=1128, y=866, z=3}
},
area = {
fromX = 1152, toX = 1155,
fromY = 844, toY = 847,
z = 2
},
storageDone = 4566,
level = 120
}, {0, 0}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end

function Wave1()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave2, 30 * 1000)
end

function Wave2()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x= 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave3, 35 * 1000)
end

function Wave3()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave4, 40 * 1000)
end

function Wave4()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave5, 40 * 1000)
end

function Wave5()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave6, 40 * 1000)
end

function Wave6()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave7, 40 * 1000)
end

function Wave7()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local failed = false
for i = 1, #t.pedestals do
player = getTopCreature(t.pedestals).uid
if(not(player > 0 and isPlayer(player) == TRUE and getPlayerStorageValue(player, t.storageDone) < 1 and getPlayerLevel(player) >= t.level)) then
failed = true
break
end
end
if not failed then
if #getCreaturesInRange({x=1137, y=866,z=3}, 10, 9, FALSE, TRUE) > 0 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Another Team is fighting in the Arena.")
return true
end
for i = 1, #player do
doTeleportThing(player, t.newPos)
end
Wave1()
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
end
return true
end

lever od not move!
 
Back
Top