Postado Setembro 15, 2018 6 anos Alguem poderia me dizer porque esse script não funciona ? é um boss e quando esse boss morre todos em determinada area recebe o premio: Obs: ja registrei no monster Mostrar conteúdo oculto local config = { playerCount = 3915, -- Global storage for counting the players left/entered in the event fromPosition = {x = 1163, y = 1056, z = 7}, -- top left cornor of the playground toPosition = {x = 1187, y = 1083, z = 7}, -- bottom right cornor of the playground } local boss1 = "Agorak" local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), config.fromPosition, config.toPosition) then table.insert(players, pid) end end function onDeath(cid) if isMonster and getCreatureName(cid) == boss1 then if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then doBroadcastMessage("O boss (".. boss1 .. ") foi morto e os jogadores dentro do World Boss Event foram recompensados com 10 event coins, 10 crystal coins e 5 event points.", MESSAGE_STATUS_CONSOLE_BLUE) for i = 1, 10 do doPlayerAddItem(cid, 2159, 10) doPlayerAddItem(cid, 2160, 10) doPlayerAddPontos(cid, 5) end end end
Postado Setembro 15, 2018 6 anos Aparece na distro algum erro?? Editado Setembro 15, 2018 6 anos por tetheuscunha (veja o histórico de edições)
Postado Setembro 16, 2018 6 anos Autor [15/9/2018 21:39:22] [Error - CreatureScript Interface] [15/9/2018 21:39:22] data/creaturescripts/scripts/world teste.lua:onDeath [15/9/2018 21:39:22] Description: [15/9/2018 21:39:22] (LuaInterface::luaDoPlayerAddItem) Player not found
Postado Setembro 16, 2018 6 anos Tenta assim: local config = { playerCount = 3915, -- Global storage for counting the players left/entered in the event fromPosition = {x = 1163, y = 1056, z = 7}, -- top left cornor of the playground toPosition = {x = 1187, y = 1083, z = 7}, -- bottom right cornor of the playground } local boss1 = "Agorak" local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), config.fromPosition, config.toPosition) then table.insert(players, pid) end end function onDeath(cid) if isMonster and getCreatureName(cid) == boss1 then if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then doBroadcastMessage("O boss (".. boss1 .. ") foi morto e os jogadores dentro do World Boss Event foram recompensados com 10 event coins, 10 crystal coins e 5 event points.", MESSAGE_STATUS_CONSOLE_BLUE) for i = 1, 10 do doPlayerAddItem(players, 2159, 10) doPlayerAddItem(players, 2160, 10) doPlayerAddPontos(players, 5) end end end
Postado Setembro 16, 2018 6 anos Autor O erro ainda continua Mostrar conteúdo oculto [16/9/2018 8:20:25] [Error - CreatureScript Interface] [16/9/2018 8:20:25] In a timer event called from: [16/9/2018 8:20:25] data/creaturescripts/scripts/world teste.lua:onDeath [16/9/2018 8:20:25] Description: [16/9/2018 8:20:25] (LuaInterface::luaDoPlayerAddItem) Player not found [16/9/2018 8:20:25] [Error - CreatureScript Interface] [16/9/2018 8:20:25] In a timer event called from: [16/9/2018 8:20:25] data/creaturescripts/scripts/world teste.lua:onDeath [16/9/2018 8:20:25] Description: [16/9/2018 8:20:25] (LuaInterface::luaDoPlayerAddItem) Player not found [16/9/2018 8:20:25] [Error - CreatureScript Interface] [16/9/2018 8:20:25] In a timer event called from: [16/9/2018 8:20:25] data/creaturescripts/scripts/world teste.lua:onDeath [16/9/2018 8:20:25] Description: [16/9/2018 8:20:25] (LuaInterface::luaGetCreatureStorage) Creature not found
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.