Ir para conteúdo

Featured Replies

Postado

Olá galera do TK,gostaria de implantar um anti teleport nessa script,no caso o player ao usar essa script,ele não poderia dar teleport com os pokemons(essa script é movements)

Citar

function onStepIn(cid, item, position, FromPosition)
local pos = {x=1345, y=1089, z=10}
doPlayerSendTextMessage(cid, 22, "Você está quase lá,basta aguentar 25minutos aqui dentro para se livrar desses terríveis monstro")
tp = addEvent(doTeleportThing, 1500*1000, cid, pos)
tp2 = addEvent(doSendMagicEffect, 1500*1000, pos, 10)
return TRUE
end


function onStepOut(cid, item, position, fromPosition)
stopEvent(tp)  
stopEvent(tp2)
return TRUE
end

Script do teleport

Citar

local poke = {"Shiny Mr. Mime", 'Mew', 'Mewtwo', 'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mr. Mime', 'Porygon', 'Shiny Abra', 'Shiny Alakazam',
'Shiny Hypno', 'Porygon2', "Jynx", "Shiny Jynx", "Slowking", "Girafarig", "Misdreavus", "Exeggutor", "Shiny Espeon", "Gardevoir"} --alterado v1.9

local etele = 0
local cdtele = 0

local config = {
premium = true, -- se precisa ser premium account (true or false)
battle = false -- se precisa estar sem battle (true). Se colocar false, poderá usar teleport no meio de batalhas
}

local places = {
-- Kanto --
[1] = {name = "Saffron", id = 1, sto = 897530},
}

function onSay(cid, words, param)
if #getCreatureSummons(cid) == 0 then
doPlayerSendCancel(cid, "Você precisa de um pokémon para usar teleport!")
return true
end

if not isInArray(poke, getCreatureName(getCreatureSummons(cid)[1])) then
return 0
end

if exhaustion.get(cid, etele) and exhaustion.get(cid, etele) > 0 then
local tempo = tonumber(exhaustion.get(cid, etele)) or 0
local min = math.floor(tempo)
doPlayerSendCancel(cid, "Your pokemon is tired, wait "..getStringmytempo(tempo).." to teleport again.")
return true
end

if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Apenas membros Premium Account podem teleportar!")
return true
end

if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end


local item = getPlayerSlotItem(cid, 8)
local nome = getPokeballName(item.uid)
local summon = getCreatureSummons(cid)[1]
local lastppos = getThingPos(cid)
local lastspos = getThingPos(summon)
local myplace = ""
local townid = 0
local citySto = 0 --alterado v1.7


for x = 1, #places do
if string.find(string.lower(places[x].name), string.lower(param)) then
townid = places[x].id
myplace = places[x].name
citySto = places[x].sto or -1 --alterado v1.7
end
end

if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end


if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end

if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end


doTeleportThing(cid, telepos, false)

local pos2 = getClosestFreeTile(cid, getPosByDir(getThingPos(cid), SOUTH))

doTeleportThing(summon, pos2, false)


doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)

return true
end

 

Editado por Gnius (veja o histórico de edições)

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.9k

Informação Importante

Confirmação de Termo