local scroll = 6119
local temple = {x=155, y=52, z=7}
local level = 25
function onUse(cid, item, frompos, item2, topos)
if (isPlayerPzLocked(cid)) then
return doPlayerSendCancel(cid, "Você não pode se teletransportar agora!")
end
if item.itemid == scroll and getPlayerLevel(cid) >= level then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(temple,10)
doSendAnimatedText(temple, "Teleport!", 5)
doRemoveItem(cid, item.uid, 0)
else
doPlayerSendCancel(cid, "Sorry, your level must higher than 25!")
end
return 1
end
[AJUDA] Item que da TP pro templo.
Por UntFrc, 13 de mar. de 2016 em Scripts
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +150
Gênero: Masculino

Editado Março 13 por PsyMcKenzie
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

Ta ai a script perfeitinha que você queria hehe, até dei uma melhorada.
local scroll = 6119 -- ID do itemlocal temple = {x=155, y=52, z=7} -- Lugar onde será teleportadolocal level = 25 -- Level minimo para poder usar o itemlocal pz = true -- players precisam estar em protection zone para usar? (true ou false)local storage = 212290 -- Storage para dar exhaustedfunction onUse(cid, item, frompos, item2, topos) if pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você precisa estar em protection zone pra poder teleportar.") end if getPlayerStorageValue(cid, storage) > os.time() then return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.") end if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) setPlayerStorageValue(cid, storage, os.time() + 300) -- tempo em segundos. doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Desculpe, você precisa ter no minimo level "..level.." para ser teleportado.") end return TRUEend
Editado Abril 24 por nedroesdoksdja
Este está com tempo e podendo usar o item apenas em protection zone
local scroll = 6119 local temple = {x=155, y=52, z=7} local level = 25 local storage = 212290 function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) > os.time() then return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.") end if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) setPlayerStorageValue(cid, storage, os.time() + 300) -- tempo em segundos. doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Sorry, your level must higher than 25!") end if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end end
A parte de funcionar somente em PZ não funcionou.
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

A parte de funcionar somente em PZ não funcionou.
Desculpe, eu estou com sono e não prestei atenção kkk editei o post olha lá que agora da certo xD
Editado Março 13 por nedroesdoksdja
Desculpe, eu estou com sono e não prestei atenção kkk editei o post olha lá que agora da certo xD
Agora foi. Valeu, brother! REP+
info
Grupo: Marquês
Registrado: 25/09/10
Posts: 1.3k
Reputação: +446
Gênero: Masculino

Tópico Movido
Este tópico foi movido de "OTServ → Scripting → Downloads Scripts → Actions, talkactions e moveevents"
para "OTServ → Scripting → Suporte Scripting".
@@Dandjes, crie seus tópicos de suporte nessa seção: http://www.xtibia.com/forum/forum/86-suporte-scripting/
e quando for resolvido clique em Resolvido no post de quem te ajudou a resolver.





info
Grupo: Campones
Registrado: 19/02/16
Posts: 95
Reputação: +27
Gênero: Outro
Eai, pessoal. Bom, ultimamente eu to postando aqui quase todo dia pedindo ajuda e tudo, mas não faria se não fosse necessario (kkkkk). Então, acho que isso é a ultima ajuda que peço aqui.
Eu tenho um script aqui (action) de um item que da TP pro templo, só que eu gostaria que ele pudesse ser usado só a cada 3 minutos e o player não pudesse estar PZ, PK, REDSKULL....
O script é o seguinte:
local scroll = 6119 local temple = {x=155, y=52, z=7} local level = 25 function onUse(cid, item, frompos, item2, topos) if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Sorry, your level must higher than 25!") end return 1 end