Postado Abril 5, 2015 10 anos Administrador Bom criei um scripts para um evento automático porem não funciona e não a presenta erro,pode me ajudar? function onUse(cid, item, fromPosition, item2, toPosition) local numPlayers = 0 -- Variavel usada para contar os players. local teleport = {x = 1712, y = 325, z = 6}, -- Local onde o player vai ser teleportado. local areaPostitions1 = {x = 1695, y = 315, z = 7}, -- Canto direito de cima. local areaPostitions2 = {x = 1726, y = 338, z = 7} -- Canto esquerdo de baixo. local itemid = 2160 -- ID do item que o player ganhará! local monstername1 = "Shiny Alakazam" -- Nome dos monstros que serão sumonados após o player clicar no item! local monstername2 = "Shiny Mr. Mime" local monstername3 = "Shiny Slowking" local monstername4 = "Shiny Gyarados" local monstername5 = "Shiny Gengar" local monstername6 = "Shiny aggron" local monster1 = {x = 1709, y = 326, z = 7} -- Coordenas de a onde o monstro irá aparecer! local monster2 = {x = 1709, y = 326, z = 7} local monster3 = {x = 1709, y = 326, z = 7} local monster4 = {x = 1709, y = 326, z = 7} local monster5 = {x = 1709, y = 326, z = 7} local monster6 = {x = 1709, y = 326, z = 7} actionstatus = getPlayerStorageValue(cid,7403) if actionstatus == -1 then if doCreatureSay(cid,"LEMBRESE TODOS OS JOGADORES TEM QUE CLICAR NA NA MAQUINA!",TALKTYPE_ORANGE_1) then else doPlayerSendTextMessageCancel(cid,MESSAGE_INFO_DESCR,"Sorry is not possible.") end function Quest() doPlayerSendTextMessage(cid,22,"Os Monstros irao aparecer em 5 Segundos.!") doPlayerAddItem(cid,itemid,25) setPlayerStorageValue(cid,7403,1) for xPos = areaPostitions1[1].x, areaPostitions2[2].x do for yPos = areaPostitions1[1].y, areaPostitions2[2].y do areaPos = getThingfromPos({x = xPos, y = yPos, z = areaPostitions1[1].z, stackpos = 255}) if(isPlayer(areaPos.uid) == TRUE)then numPlayers = numPlayers+1 end end end if(numPlayers >= 1)then doTeleportThing(cid, teleport) doBroadcastMessage("O evento Sobrevivencia terminou.") else doBroadcastMessage("O evento Sobrevivencia terminou. e ninguem ganou") end end function Summon() doSummonCreature(monstername1,monster1) doSummonCreature(monstername2,monster2) doSummonCreature(monstername3,monster3) doSummonCreature(monstername4,monster3) doSummonCreature(monstername5,monster3) doSummonCreature(monstername6,monster3) doSendMagicEffect(monster1,301) doSendMagicEffect(monster2,301) doSendMagicEffect(monster3,301) doSendMagicEffect(monster4,301) doSendMagicEffect(monster5,301) doSendMagicEffect(monster6,301) end addEvent(Summon,500) addEvent(Summon,5000) addEvent(Quest,6000) end end Editado Abril 5, 2015 10 anos por Erimyth (veja o histórico de edições) TibiaKing Team- KingTópicos www.tibiaking.com
Postado Abril 5, 2015 10 anos local config = { [1] = {monstername= "Shiny Alakazam", pos= {x = 1709, y = 326, z = 7}}, [2] = {monstername= "Shiny Mr. Mime", pos= {x = 1709, y = 326, z = 7}}, [3] = {monstername= "Shiny Slowking", pos= {x = 1709, y = 326, z = 7}}, [4] = {monstername= "Shiny Gyarados", pos= {x = 1709, y = 326, z = 7}}, [5] = {monstername= "Shiny Gengar", pos= {x = 1709, y = 326, z = 7}}, [6] = {monstername= "Shiny Agrron", pos= {x = 1709, y = 326, z = 7}}, } local event = { id_item = 2160, -- Id do item que o cara vai ganhar teleport = {x = 1712, y = 325, z = 6}, -- Local onde o player vai ser teleportado, toPos = {x = 1695, y = 315, z = 7}, -- Canto direito de cima. fromPos = {x = 1726, y = 338, z = 7}, -- Canto esquerdo de baixo. storage = 7403, -- Não mexer.. } function Quest() doPlayerSendTextMessage(cid, 22,"Os Monstros irao aparecer em 5 Segundos.!") doPlayerAddItem(cid, event.id_item, 25) setPlayerStorageValue(cid, event.storage, 1) numPlayers = 0 for x = event.toPos.x, event.fromPos.x do for y = event.toPos.y, event.fromPos.y do areaPos = getThingfromPos({x = x, y = y, z = event.fromPos.z}).uid if isPlayer(areaPos) then numPlayers = numPlayers + 1 end end end if numPlayers >= 1 then doTeleportThing(cid, event.teleport) doBroadcastMessage("O evento Sobrevivencia terminou.") else doBroadcastMessage("O evento Sobrevivencia terminou. e ninguem ganou") end return true end function Summon() for x = 1, #config do doSummonCreature(config[x].monstername, config[x].pos) doSendMagicEffect(config[x].pos, 301) end return true end function onUse(cid, item, fromPosition, item2, toPosition) if getPlayerStorageValue(cid, event.strogae) < 1 then doCreatureSay(cid,"Todos jogadores tem que clicar na maquina!",TALKTYPE_ORANGE_1) then else doPlayerSendTextMessageCancel(cid,MESSAGE_INFO_DESCR,"Sorry is not possible.") end addEvent(Summon,500) addEvent(Summon,5000) addEvent(Quest,6000) return true end
Postado Abril 6, 2015 10 anos Autor Administrador testando, jaja edito apresentou o erro na seguinte linha if getPlayerStorageValue(cid, event.strogae) < 1 then doCreatureSay(cid,"Todos jogadores tem que clicar na maquina!",TALKTYPE_ORANGE_1) then else então eu removi o "then" Funcionou,porem nao adiciona a storage e nem teleporta os jogadores pro local depois que a maquina acaba de sumonar os monstros @up Editado Abril 6, 2015 10 anos por Erimyth (veja o histórico de edições) TibiaKing Team- KingTópicos www.tibiaking.com
Postado Abril 7, 2015 10 anos Autor Administrador Solução @up TibiaKing Team- KingTópicos www.tibiaking.com
Postado Abril 7, 2015 10 anos bom eu tenho um script aki que teleporta e sumona monstros, porem qnd eu matava os monstros e dava uma enroladinha pra sair do lugar que eles nasceram dava um errinho na distro, segue script (pasta actions) crie um arquivo com qualquer nome e ponha issu -- Annihilator by Shawak v2.1 -- CONFIG -- local room = { -- room with demons fromX = 663, fromY = 1161, fromZ = 8, -------------- toX = 703, toY = 1289, toZ = 8 } local monster_pos = { [1] = {pos = {690, 1278, 8}, monster = "Pikachu"}, [2] = {pos = {688, 1254, 8}, monster = "Charizard"}, [3] = {pos = {689, 1227, 8}, monster = "Squirtle"}, [4] = {pos = {687, 1201, 8}, monster = "Abra"}, [5] = {pos = {673, 1169, 8}, monster = "Seviper"} } local players_pos = { {x = 669, y =1171, z = 7, stackpos = 253} --{x = 547, y =1127, z = 7, stackpos = 253}, -- {x = 549, y =1127, z = 7, stackpos = 253} } local new_player_pos = { {x = 690, y =1278, z = 8} -- {x = 542, y =1126, z = 8}, --{x = 542, y =1127, z = 8} } local playersOnly = "yes" local questLevel = 150 ------------------------------------------------------ --- CONFIG END --------------------------------------- ------------------------------------------------------ function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 99284) == 1 then doPlayerSendCancel(cid, "Desculpe mais não pode entrar com camera.") return false end 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) == "yes" 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 then for _, area in pairs(monster_pos) do doCreateNpc(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 doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.") 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 end e a tag dele no xml <action uniqueid="Id unique que sera colocado no item x que ira teleportar" event="script" value="Nome do Arquivo criado.lua"/> bom se alguém conseguir arrumar o erro eu agradeço xD Minhas Gambiarras [PDA] Pokedex Mostrando o Catch http://www.tibiaking.com/forum/topic/54998-pda-arrumando-a-dex/?view=findpost&p=323041
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.