Kod:
createpos = {x=507,y=486,z=7}
topos = {x=674,y=450,z=8}
fromPos = {x = 663, y = 446, z = 8}
toPos = {x = 696, y = 463, z = 8}
pos_spawn={
pos1={x = 674, y = 450, z = 8},
pos2={x = 696, y = 463, z = 8},
pos3={x = 675, y = 452, z = 8},
pos4={x = 673, y = 462, z = 8},
pos5={x = 680, y = 461, z = 8}
}
spawned = 0
function StartSpawnMonsters()
config={
monsters_count={35,25,30,21},
monsters={"Chibi Gunso", "Gunso", "Chibi Rocco", "Rocco"}
}
rand=math.random(1, 4)
doBroadcastMessage(config.monsters[rand])
repeat
doCreateMonster(config.monsters[rand], pos_spawn[rand])
spawned = spawned + 1
until spawned == config.monsters_count[rand]
if spawned == config.monsters_count[rand] then
KickPlayers()
end
end
function CreateTeleport()
doBroadcastMessage("[EVENT]Gdzies w miescie pojawil sie teleport na arene. Odszukaj go i zniszcz przeciwnikow.")
doCreateTeleport(1387, topos, createpos)
StartSpawnMonsters()
return true
end
function KickPlayers()
local get = getThingfromPos(create_pos)
doRemoveItem(get.uid)
if(isInArea(getCreaturePosition(cid), fromPos, toPos) == TRUE) then
doTeleportThing(cid, createpos)
end
end
function onThink(interval, lastExecution, thinkInterval)
doBroadcastMessage("[EVENT]Arena Of Champions zaraz sie zacznie!")
addEvent(CreateTeleport, 30000)
return true
end
Error w konsoli:
[Error - GlobalEvent Interface]
[21/02/2015 22:57:25] In a timer event called from:
[21/02/2015 22:57:25] data/globalevents/scripts/arena.luanThink
[21/02/2015 22:57:25] Description:
[21/02/2015 22:57:25] attempt to index a nil value
[21/02/2015 22:57:25] stack traceback:
[21/02/2015 22:57:25] [C]: in function 'doCreateMonster'
[21/02/2015 22:57:25] data/globalevents/scripts/arena.lua:21: in function 'StartSpawnMonsters'
[21/02/2015 22:57:25] data/globalevents/scripts/arena.lua:31: in function <data/globalevents/scripts/arena.lua:28>
createpos = {x=507,y=486,z=7}
topos = {x=674,y=450,z=8}
fromPos = {x = 663, y = 446, z = 8}
toPos = {x = 696, y = 463, z = 8}
pos_spawn={
pos1={x = 674, y = 450, z = 8},
pos2={x = 696, y = 463, z = 8},
pos3={x = 675, y = 452, z = 8},
pos4={x = 673, y = 462, z = 8},
pos5={x = 680, y = 461, z = 8}
}
spawned = 0
function StartSpawnMonsters()
config={
monsters_count={35,25,30,21},
monsters={"Chibi Gunso", "Gunso", "Chibi Rocco", "Rocco"}
}
rand=math.random(1, 4)
doBroadcastMessage(config.monsters[rand])
repeat
doCreateMonster(config.monsters[rand], pos_spawn[rand])
spawned = spawned + 1
until spawned == config.monsters_count[rand]
if spawned == config.monsters_count[rand] then
KickPlayers()
end
end
function CreateTeleport()
doBroadcastMessage("[EVENT]Gdzies w miescie pojawil sie teleport na arene. Odszukaj go i zniszcz przeciwnikow.")
doCreateTeleport(1387, topos, createpos)
StartSpawnMonsters()
return true
end
function KickPlayers()
local get = getThingfromPos(create_pos)
doRemoveItem(get.uid)
if(isInArea(getCreaturePosition(cid), fromPos, toPos) == TRUE) then
doTeleportThing(cid, createpos)
end
end
function onThink(interval, lastExecution, thinkInterval)
doBroadcastMessage("[EVENT]Arena Of Champions zaraz sie zacznie!")
addEvent(CreateTeleport, 30000)
return true
end
Error w konsoli:
[Error - GlobalEvent Interface]
[21/02/2015 22:57:25] In a timer event called from:
[21/02/2015 22:57:25] data/globalevents/scripts/arena.luanThink
[21/02/2015 22:57:25] Description:
[21/02/2015 22:57:25] attempt to index a nil value
[21/02/2015 22:57:25] stack traceback:
[21/02/2015 22:57:25] [C]: in function 'doCreateMonster'
[21/02/2015 22:57:25] data/globalevents/scripts/arena.lua:21: in function 'StartSpawnMonsters'
[21/02/2015 22:57:25] data/globalevents/scripts/arena.lua:31: in function <data/globalevents/scripts/arena.lua:28>