Ir para conteúdo

Featured Replies

Postado

eu queria que essa magia nao podesse ser usada em x lugar 

segue o script

local config = {
pos = {x=1765, y=578, z=7}, -- 
tempo = 30, --
effect1 = 10, --
effect2 = 10 -- 
}








function onCastSpell(cid, var)
if isPlayer(getCreatureTarget(cid)) then
target = getCreatureTarget(cid)
addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
doSendMagicEffect(getThingPos(target), config.effect1)
doTeleportThing(target, config.pos)
if isCreature(cid) then
doPlayerSendTextMessage(target, 27, "Voce  ".. getCreatureName(cid) ..".")
end
if isPlayer(cid) and isCreature(target) then
doPlayerSendTextMessage(cid, 27, "Voce levou para ".. getCreatureName(target) .."!")
end
else
doPlayerSendCancel(cid, "Voces")
end
return true
end

 

Resolvido por Vodkart

Ir para solução
  • Respostas 11
  • Visualizações 733
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = { pos = {x=1765, y=578, z=7}, -- tempo = 30, -- effect1 = 10, -- effect2 = 10 -- } local fromPosition = {x=1031, y=737, z=7} local toPosition = {x=1031, y=737, z=7} function onCast

  • kk ainda bem que copiou bem certinho     local config = {pos = {x=1765, y=578, z=7},tempo = 30,effect1 = 10,effect2 = 10} local areas ={ -- areas bloqueadas {from = {x=97, y=1773, z=7},t

Postado
local config = {
pos = {x=1765, y=578, z=7}, -- 
tempo = 30, --
effect1 = 10, --
effect2 = 10 -- 
}

local fromPosition = {x=1031, y=737, z=7} 
local toPosition =  {x=1031, y=737, z=7}
function onCastSpell(cid, var)
local pos = getCreaturePosition(cid)
         if isInRange(pos, fromPosition, toPosition) then
            doPlayerSendTextMessage(cid, 27, "Voce nao pode usar essa magia nesse local")
            return doSendMagicEffect(pos, 3)
         end
if isPlayer(getCreatureTarget(cid)) then
target = getCreatureTarget(cid)
addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
doSendMagicEffect(getThingPos(target), config.effect1)
doTeleportThing(target, config.pos)
if isCreature(cid) then
doPlayerSendTextMessage(target, 27, "Voce  ".. getCreatureName(cid) ..".")
end
if isPlayer(cid) and isCreature(target) then
doPlayerSendTextMessage(cid, 27, "Voce levou para ".. getCreatureName(target) .."!")
end
else
doPlayerSendCancel(cid, "Voces")
end
return true
end

 

Postado
local config = {pos = {x=1765, y=578, z=7},tempo = 30,effect1 = 10,effect2 = 10}
local areas ={ -- areas bloqueadas
{from = {x=1014,y=1016,z=7},to = {x=1017,y=1019,z=7}}, -- começo da area e final da area
{from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}}
}
function onCastSpell(cid, var)
for _, var in ipairs(areas) do
    if isInRange(getCreaturePosition(cid), var.from, var.to) then
       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce nao pode usar essa magia nesse local") return true
    end
end
if isPlayer(getCreatureTarget(cid)) then
target = getCreatureTarget(cid)
addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
doSendMagicEffect(getThingPos(target), config.effect1)
doTeleportThing(target, config.pos)
if isCreature(cid) then
doPlayerSendTextMessage(target, 27, "Voce  ".. getCreatureName(cid) ..".")
end
if isPlayer(cid) and isCreature(target) then
doPlayerSendTextMessage(cid, 27, "Voce levou para ".. getCreatureName(target) .."!")
end
else
doPlayerSendCancel(cid, "Voces")
end
return true
end

 

 

já n tinha feito da talk pra vc?

 

usa o msm metodo...

 

https://tibiaking.com/forums/topic/89133-help-fly-system-colocar-para-nao-usar-em-x-area/?tab=comments#comment-489941

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

@Vodkart deu esse erro:

[28/05/2018 11:01:30] [Error - LuaScriptInterface::loadFile] data/spells/scripts/carvalho/kamui1.lua:33: 'end' expected (to close 'function' at line 6) near '<eof>'
[28/05/2018 11:01:30] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/carvalho/kamui1.lua)
[28/05/2018 11:01:30] data/spells/scripts/carvalho/kamui1.lua:33: 'end' expected (to close 'function' at line 6) near '<eof>'
[28/05/2018 11:01:30] [Error - LuaScriptInterface::loadFile] data/spells/scripts/carvalho/kamui1.lua:33: 'end' expected (to close 'function' at line 6) near '<eof>'
[28/05/2018 11:01:31] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/carvalho/kamui1.lua)
[28/05/2018 11:01:31] data/spells/scripts/carvalho/kamui1.lua:33: 'end' expected (to close 'function' at line 6) near '<eof>'

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.7k

Informação Importante

Confirmação de Termo