Postado Agosto 29, 2017 7 anos Autor Em 23/08/2017 em 19:15, Dwarfer disse: local t = { newpos = {x=1,y=1,z=1}, effect = CONST_ME_TELEPORT, vocations = {1,2,3,4}, id = 2160, remover = "yes", level = 10, tempo = 30 -- em segundos } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 19883) - os.time() > 0 then return doPlayerSendCancel(cid, "Você deve esperar "..t.tempo.." segundos para usar novamente.") end if getPlayerItemCount(cid, t.id) == 0 then return doPlayerSendCancel(cid, "Você não tem o item necessário.") end if getPlayerLevel(cid) < t.level then return doPlayerSendCancel(cid, "O level mínimo requerido é "..t.level.." .") end if not isInArray(t.vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Você não tem a vocação necessária.") end if not isPremium(cid) then return doPlayerSendCancel(cid, "Você não é premium.") end setPlayerStorageValue(cid, 19883, t.tempo + os.time()) doTeleportThing(cid, t.newpos) doSendMagicEffect(t.newpos, t.effect) if t.remover == "yes" then doPlayerRemoveItem(cid, t.id, 1) end return true end @Dwarfer voce conseguiria transformar isso num portal tambem? (sem dar use em nada, apenas passar por dentro)
Postado Agosto 29, 2017 7 anos Crie um arquivo em movements/scripts: Spoiler local t = { newpos = {x=1,y=1,z=1}, effect = CONST_ME_TELEPORT, vocations = {1,2,3,4}, id = 2160, remover = "yes", level = 10, tempo = 30 -- em segundos } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) check = true if getPlayerStorageValue(cid, 19883) - os.time() > 0 then doPlayerSendCancel(cid, "Você deve esperar "..t.tempo.." segundos para entrar novamente.") check = false end if getPlayerItemCount(cid, t.id) == 0 then doPlayerSendCancel(cid, "Você não tem o item necessário.") check = false end if getPlayerLevel(cid) < t.level then doPlayerSendCancel(cid, "O level mínimo requerido é "..t.level.." .") check = false end if not isInArray(t.vocations, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Você não tem a vocação necessária.") check = false end if not isPremium(cid) then doPlayerSendCancel(cid, "Você não é premium.") check = false end if check == false then return doTeleportThing(cid, fromPosition) end setPlayerStorageValue(cid, 19883, t.tempo + os.time()) doTeleportThing(cid, t.newpos) doSendMagicEffect(t.newpos, t.effect) if t.remover == "yes" then doPlayerRemoveItem(cid, t.id, 1) end end Em movements.xml, adicione a tag: <movevent type="StepIn" actionid="ACTIONIDDOPORTAL" event="script" value="NOMEDOARQUIVO.lua"/> Contato: Email: [email protected] Discord: Dwarfer#2715
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.