Postado Maio 27, 2018 7 anos 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
Postado Maio 27, 2018 7 anos 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 Maio 28, 2018 7 anos Autor @Sttorm eu queria tipo uma tabela por que e muitos lugares que vou botar Editado Maio 28, 2018 7 anos por Jociel (veja o histórico de edições)
Postado Maio 28, 2018 7 anos 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 [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Maio 28, 2018 7 anos 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.