Postado Julho 30, 2015 9 anos Sem chave: elseif (labelName == "PortaUm") then Walker.Stop() print([[Checando a porta..]]) if Map.IsTileWalkable(32999, 32096, 6) == false then Self.UseItemFromGround(32999, 32096, 6) end wait(2000,3000) Walker.Start() Só trocar a position em Map.IsTileWalkable e no Self.UseItemFromGround para a posição da porta. Com chave você faz uma checagem para voltar: elseif labelName == 'PortaUm' then Walker.Stop() print('Checando porta...') wait(1500,2000) if Map.IsTileWalkable(32655, 31655, 9) == false then openDoor(CHAVEID, 32655, 31655, 9) end Walker.Start() elseif labelName == 'CheckPortaUm' then Walker.Stop() wait(500) if Map.IsTileWalkable(32655, 31655, 9) == false then gotoLabel('PortaUm') end Walker.Start() Troque as positions em Map.IsTileWalkable e em openDoor coloque a chave e troque as positions. No final do script depois de fechar a função de label, adicione a função openDoor: function openDoor(keyID, x, y, z) for i = 0, #Container.GetIndexes() - 1 do local Cont = Container.New(i) if Cont:CountItemsOfID(keyID) > 0 then for s = 0, Cont:ItemCount() do local item = Cont:GetItemData(s) if item.id == keyID then Cont:UseItemWithGround(s, x, y, z) end end end end end ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 30, 2015 9 anos Autor Em 30/07/2015 em 01:21, Wakon disse: elseif (labelName == "PortaUm") then Walker.Stop() print([[Checando a porta..]]) if Map.IsTileWalkable(32999, 32096, 6) == false then Self.UseItemFromGround(32999, 32096, 6) end wait(2000,3000) Walker.Start() Só trocar a position em Map.IsTileWalkable e no Self.UseItemFromGround para a posição da porta. vlw brow testar aqui Brow, ela não abre porta trancada... você tem um ai que abre com a chave ? me ajudaria muito pois a hunt que quero fazer tem q abrir a porta com a chave
Postado Julho 30, 2015 9 anos Em 30/07/2015 em 01:38, tonarave disse: vlw brow testar aqui Brow, ela não abre porta trancada... você tem um ai que abre com a chave ? me ajudaria muito pois a hunt que quero fazer tem q abrir a porta com a chave Editei o comentário acima. ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 30, 2015 9 anos Autor Em 30/07/2015 em 01:21, Wakon disse: Sem chave: elseif (labelName == "PortaUm") then Walker.Stop() print([[Checando a porta..]]) if Map.IsTileWalkable(32999, 32096, 6) == false then Self.UseItemFromGround(32999, 32096, 6) end wait(2000,3000) Walker.Start() Só trocar a position em Map.IsTileWalkable e no Self.UseItemFromGround para a posição da porta. Com chave você faz uma checagem para voltar: elseif labelName == 'PortaUm' then Walker.Stop() print('Checando porta...') wait(1500,2000) if Map.IsTileWalkable(32655, 31655, 9) == false then openDoor(CHAVEID, 32655, 31655, 9) end Walker.Start() elseif labelName == 'CheckPortaUm' then Walker.Stop() wait(500) if Map.IsTileWalkable(32655, 31655, 9) == false then gotoLabel('PortaUm') end Walker.Start() Troque as positions em Map.IsTileWalkable e em openDoor coloque a chave e troque as positions. No final do script depois de fechar a função de label, adicione a função openDoor: function openDoor(keyID, x, y, z) for i = 0, #Container.GetIndexes() - 1 do local Cont = Container.New(i) if Cont:CountItemsOfID(keyID) > 0 then for s = 0, Cont:ItemCount() do local item = Cont:GetItemData(s) if item.id == keyID then Cont:UseItemWithGround(s, x, y, z) end end end end end Brow na linha onde está : function openDoor(keyID, x, y, z) eu preciso trocar o KeyID e o x,y,z pelas coordenadas do waypoints ? e o ID da chave
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.