Hello I decided to create this script, for I am in the basics of lua (; Let's start; The script consists of; If you have an item, the click, open a tp in Part X (configurable) for X time, and after that time, it closes. Since the test, and use it as a quest.
actions.xml
Credits;
100% Rhyxz
Code:
local m = {
item = ?????,
time = 10, -- Segundos en el que podrás utilizar el teleport
to = { x = 1847, y = 1747, z = 10 }, -- Dónde te lleva el teleport
tp = { x = 1843, y = 1747, z = 10 } -- Dónde aparece el teleport.
}
local function deleteTeleport()
local teleport = getTileItemById(m.tp, 1387)
if(teleport.uid > 0) then
doRemoveItem(teleport.uid)
doSendMagicEffect(m.tp, CONST_ME_POFF)
doSendAnimatedText(m.tp, "Cerrado, llegaste tarde", TEXTCOLOR_RED)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveItem(cid, m.item) then
doPlayerSendTextMessage(cid, ???????????, "Apresurate Se Ah Abierto")
else
doPlayerSendCancel(cid, "No tienes el item")
end
if(???????????) then
doCreateTeleport(1387, m.to, m.tp)
addEvent(deleteTeleport, m.time*1000)
doCreatureSay(cid, "Tu tienes " .. m.time .. " segundos para seguir!", TALKTYPE_ORANGE_1)
end
return true
end
actions.xml
Code:
<action itemid="XXXX" event="script" value="tportal.lua"/>
Credits;
100% Rhyxz
Last edited: