Postado Janeiro 8, 2015 10 anos Autor Na primeira linha do seu script coloque isso: local config = { time = 5, -- Tempo, em segundos, que o teleport existir pos = {x = 1150, y = 848, z = 7}, -- Posição a onde o teleport vai levar } local function teleportRemove(pos) local tp = getTileItemById(pos, 1387).uid if tp > 100 then doRemoveItem(tp) return true end return false end E, onde está usando doCreateTeleport(1387, {x = 1150, y = 848, z = 7} , getCreaturePosition(cid)) Use doCreateTeleport(1387, config.pos , getCreaturePosition(cid)) doTeleportThing(cid, config.pos) addEvent(teleportRemove, config.time * 1000, getCreaturePosition(cid)) Vlw arrumou 1 coisa q eu queria mas o portal continua a ficar ali pra sempre ;x esse aki é o script da spell n sei se é eu q coloquei errado entao vo deichar aki VV local config = { time = 5, -- Tempo, em segundos, que o teleport existir pos = {x = 1150, y = 848, z = 7}, -- Posição a onde o teleport vai levar } local function teleportRemove(pos) local tp = getTileItemById(pos, 1387).uid if tp > 100 then doRemoveItem(tp) return true end return false end local storage = 987123 -- storage local time = 5 -- tempo em segundos que o item vai ficar na posição. local pos = {} function terminus(cid) if isPlayer(cid) then for index, pid in pairs(pos) do if index == getCreatureName(cid) then local a = getTileItemById(pos[index], item) if a.uid > 0 then doRemoveItem(a.uid) end end end doPlayerSendTextMessage(cid, 22, "O item sumiu.") end end function onCastSpell(cid, var) doCreateTeleport(1387, config.pos , getCreaturePosition(cid)) doTeleportThing(cid, config.pos) addEvent(teleportRemove, config.time * 1000, getCreaturePosition(cid)) if getPlayerStorageValue(cid, storage) - os.time() <= 0 then pos[getCreatureName(cid)] = getCreaturePosition(cid) setPlayerStorageValue(cid, storage, os.time()+time) doCreateItem(item, getCreaturePosition(cid)) doSendMagicEffect(getCreaturePosition(cid), 3) addEvent(terminus, time*1000, cid) elseif getPlayerStorageValue (cid, storage) - os.time() >= 1 then for index, pid in pairs(pos) do if index == getCreatureName(cid) then doTeleportThing(cid, pid) doSendMagicEffect(getCreaturePosition(cid), 10) end end end return true end
Postado Janeiro 8, 2015 10 anos Solução local config = { time = 5, -- Tempo, em segundos, que o teleport existir pos = {x = 1150, y = 848, z = 7}, -- Posição a onde o teleport vai levar } local function teleportRemove(pos) local tp = getTileItemById(pos, 1387).uid if tp > 100 then doRemoveItem(tp) return true end return false end local storage = 987123 -- storage local time = 5 -- tempo em segundos que o item vai ficar na posição. local pos = {} function terminus(cid) if isPlayer(cid) then for index, pid in pairs(pos) do if index == getCreatureName(cid) then local a = getTileItemById(pos[index], item) if a.uid > 0 then doRemoveItem(a.uid) end end end doPlayerSendTextMessage(cid, 22, "O item sumiu.") end end function onCastSpell(cid, var) local c_pos = getCreaturePosition(cid) doCreateTeleport(1387, config.pos , c_pos) doTeleportThing(cid, config.pos) addEvent(teleportRemove, config.time * 1000, c_pos) if getPlayerStorageValue(cid, storage) - os.time() <= 0 then pos[getCreatureName(cid)] = getCreaturePosition(cid) setPlayerStorageValue(cid, storage, os.time()+time) doCreateItem(item, getCreaturePosition(cid)) doSendMagicEffect(getCreaturePosition(cid), 3) addEvent(terminus, time*1000, cid) elseif getPlayerStorageValue (cid, storage) - os.time() >= 1 then for index, pid in pairs(pos) do if index == getCreatureName(cid) then doTeleportThing(cid, pid) doSendMagicEffect(getCreaturePosition(cid), 10) end end end return true end -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
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.