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

Co nie działa?

Leman

Dragon Ball Furies OT: 67%
Joined
Sep 21, 2014
Messages
82
Reaction score
5
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.lua:eek:nThink
[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>
 
Zamień:
Code:
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}
}
na:
Code:
pos_spawn = {
    [1] = {x = 674, y = 450, z = 8},
    [2] = {x = 696, y = 463, z = 8},
    [3] = {x = 675, y = 452, z = 8},
    [4] = {x = 673, y = 462, z = 8},
    [5] = {x = 680, y = 461, z = 8}
}


i czy w:
Code:
local get = getThingfromPos(create_pos)
nie chodziło o createpos?
 
Nie działa, 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={
[1]={x = 674, y = 450, z = 8},
[2]={x = 696, y = 463, z = 8},
[3]={x = 675, y = 452, z = 8},
[4]={x = 673, y = 462, z = 8},
[5]={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
doSummonMonster(config.monsters[rand], pos_spawn[rand])
spawned = spawned + 1
until spawned == config.monsters_count[rand]
if spawned == config.monsters_count[rand] then
addEvent(KickPlayers, 3600)
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()
createpos = {x=507,y=486,z=7}
get = getThingFromPos(createpos)
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

Errory:
Nie może zespawnić potworów i addevent nil value.
 
Back
Top