Postado Outubro 17, 2015 10 anos gostaria de uma spell que teleportasse o char para uma dimençao , porem nao podendo usar essa spell quando estiver com battle e quando estiver na arena
Postado Outubro 17, 2015 10 anos O que seria essa "arena"?PS: Qual TFS?edit:Sem check de area pq odeio fazer checks de área, sempre da errado. local pos = {x=1, y=2, z=3} if(getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, 21, "Can't use this while you're with pz.") else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doTeleportThing(cid, pos) doSendMagicEffect(pos, CONST_ME_TELEPORT) end Editado Outubro 17, 2015 10 anos por vankk (veja o histórico de edições) Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
Postado Outubro 17, 2015 10 anos Autor [Error - Spell Interface]data/spells/scripts/ teleport world.luaDescription :(luaGetThingPosition) Thing not found[ Warning - Event :: LoadScript ] Event onCastSpell not found (data/spells/scripts/teleport world.lua
Postado Outubro 17, 2015 10 anos Tenta esse lek local config = {pos = {x=1596, y=738, z=7}, -- posição que será teleportadotempo = 5, -- tempo pra voltareffect1 = 75, -- efeito ao ser teleportadoeffect2 = 75, -- efeito ao voltarstorage = 19329, -- storage que fica guardado o cooldownfrom = {x=1059, y=734, z=7}, --- quina do kamui (pra impedir players de usarem o kamui dentro do kamui)to = {x=1600, y=742, z=7}, --- quina do kamui (pra impedir players de usarem o kamui dentro do kamui)cooldown = 180, --- tempo entre um uso e outro (após usar a spell vc vai ficar X segundos sem poder usar ela novamente)msg = "KAMUI OUT!" -- mensagem ao sair do kamui}local exceptions = {'training', 'gamabunta','trainer', 'fish king', 'kisame boss', 'itachi boss', 'konan boss', 'naruto boss', 'tobi boss', 'kakuzu boss'} --- nome das criaturas que não poderão ser levadas pro kamui (sempre em minúsculo e entre aspas)function canEffect(pos, pz, proj) -- Night Wolf based on Nordif getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false endif getTilePzInfo(pos) and not pz then return false endlocal n = not proj and 3 or 2for i = 0, 255 dopos.stackpos = ilocal tile = getTileThingByPos(pos)if tile.itemid ~= 0 and not isCreature(tile.uid) thenif hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) thenreturn falseendendendreturn trueendfunction onCastSpell(cid, var)local pos = getPlayerPosition(cid)if isInRange(pos, config.from, config.to) thendoPlayerSendCancel(cid, "You cannot use Kamui spell inside the Kamui!")return falseendif os.time() - getPlayerStorageValue(cid, config.storage) >= config.cooldown thendoPlayerSetStorageValue(cid, config.storage, os.time())if isCreature(getCreatureTarget(cid)) thentarget = getCreatureTarget(cid)for i = 1, #exceptions doif getCreatureName(target):lower() == exceptions thendoPlayerSendCancel(cid, "You can't take ".. getCreatureName(target) .." to Kamui.")return falseendend--------------- PLAYER-----------addEvent(doTeleportThing, 1000*config.tempo, cid, pos, true)addEvent(doCreatureSay, 1000*config.tempo, cid, config.msg, 20, false)addEvent(doSendMagicEffect, 1000*config.tempo, pos, config.effect2)doSendMagicEffect(pos, config.effect1)doTeleportThing(cid, config.pos)-------------------- OPONENTE ----------------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 isPlayer(target) and isCreature(cid) thendoPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".")endif isPlayer(cid) and isCreature(target) thendoPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!")endfor i = 1,config.tempo doaddEvent(function()if isPlayer(target) thendoPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")endif isPlayer(cid) thendoPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")endend, 1000*i)endelse---------- levar quem tá em volta do player ---------------local teleportPosition = {{x = pos.x, y = pos.y - 1, z = pos.z},{x = pos.x, y = pos.y + 1, z = pos.z},{x = pos.x - 1, y = pos.y, z = pos.z},{x = pos.x + 1, y = pos.y, z = pos.z},{x = pos.x - 1, y = pos.y + 1, z = pos.z},{x = pos.x - 1, y = pos.y - 1, z = pos.z},{x = pos.x + 1, y = pos.y - 1, z = pos.z},{x = pos.x + 1, y = pos.y + 1, z = pos.z}}local mobas = {}local checker = 0 for _, tPos in ipairs(teleportPosition) dodoSendMagicEffect(tPos, config.effect2)local mob = getTopCreature(tPos).uid if canEffect (tPos) and mob ~= 0 and (isMonster(mob) or isPlayer(mob)) thenfor i = 1, #exceptions doif getCreatureName(mob):lower() == exceptions thenchecker = 1breakendendif checker ~= 1 thentable.insert(mobas, mob) endendendif #mobas > 0 thenfor _, pid in ipairs(mobas) doaddEvent(doTeleportThing, 1000*config.tempo, pid, getThingPos(pid), true)addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(pid), config.effect2)doSendMagicEffect(getThingPos(pid), config.effect1)doTeleportThing(pid, config.pos)if isPlayer(pid) and isCreature(cid) thendoPlayerSendTextMessage(pid, 27, "You were teleported by ".. getCreatureName(cid) ..".")endfor i = 1,config.tempo doaddEvent(function()if isPlayer(pid) thendoPlayerSendTextMessage(pid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")endend, 1000*i)endendend----------------------------addEvent(doTeleportThing, 1000*config.tempo, cid, pos, true)addEvent(doCreatureSay, 1000*config.tempo, cid, config.msg, 20, false)addEvent(doSendMagicEffect, 1000*config.tempo, pos, config.effect2)doSendMagicEffect(pos, config.effect1)doTeleportThing(cid, config.pos)if isPlayer(cid) thendoPlayerSendTextMessage(cid, 27, "You teleported yourself.")endfor i = 1,config.tempo doaddEvent(function()if isPlayer(cid) thendoPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")endend, 1000*i)endendelsedoPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, config.storage))).." seconds.")endreturn trueend
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.