1
[Pedido] Script de Palanca Miér Sep 13, 2017 11:55 pm
drunknow

Nuevo Miembro

Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...
local timetoreset = 5 -- tiempo en minutos que vuelve aparecer la piedra.
local objectid = xxxx -- Id de la piedra
local ItemID = xxxx -- Id del item necesario para jalar la palanca
local Count = xxxx -- cantidad necesaria del item
local p = {
Position(x, y, z) -- Position of the item blocking the path
}
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
local stone = Tile(p[1])
local tp = Tile(p[2])
if item.itemid == 1945 then
if (player:removeItem(ItemID, Count) == true) then
cid:sendTextMessage(MESSAGE_EVENT_ORANGE, 'The object in your path has been removed for ' .. timetoreset .. ' minutes.')
stone:getItemById(objectid):remove()
p[1]:sendMagicEffect(CONST_ME_POFF)
p[2]:sendMagicEffect(CONST_ME_TELEPORT)
Item(item.uid):transform(1946)
addEvent(function(stonePos)
Game.createItem(objectid, 1, stonePos)
stonePos:sendMagicEffect(CONST_ME_TELEPORT)
p[2]:sendMagicEffect(CONST_ME_POFF)
tp:getItemById(1387):remove()
Tile(toPosition):getItemById(1946):transform(1945)
end, timetoreset * 60000, stone:getPosition())
else
doPlayerSendCancel(cid, "You do not have item.")
end
elseif item.itemid == 1946 then
return false
end
return true
end
local timetoreset = 5 -- tiempo en minutos que vuelve aparecer la piedra.
local objectid = xxxx -- Id de la piedra
local ItemID = xxxx -- Id del item necesario para jalar la palanca
local Count = xxxx -- cantidad necesaria del item
local p = {
Position(x, y, z) -- Position of the item blocking the path
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local stone = Tile(p[1])
local tp = Tile(p[2])
if item.itemid == 1945 then
if (player:removeItem(ItemID, Count) == true) then
player:sendTextMessage(MESSAGE_EVENT_ORANGE, 'The object in your path has been removed for ' .. timetoreset .. ' minutes.')
stone:getItemById(objectid):remove()
p[1]:sendMagicEffect(CONST_ME_POFF)
p[2]:sendMagicEffect(CONST_ME_TELEPORT)
Item(item.uid):transform(1946)
addEvent(function(stonePos)
Game.createItem(objectid, 1, stonePos)
stonePos:sendMagicEffect(CONST_ME_TELEPORT)
p[2]:sendMagicEffect(CONST_ME_POFF)
tp:getItemById(1387):remove()
Tile(toPosition):getItemById(1946):transform(1945)
end, timetoreset * 60000, stone:getPosition())
else
player:sendCancelMessage("You do not have item.")
end
elseif item.itemid == 1946 then
return false
end
return true
end
local timetoreset = 5 -- tiempo en minutos que vuelve aparecer la piedra.
local objectid = xxxx -- Id de la piedra
local ItemID = xxxx -- Id del item necesario para jalar la palanca
local Count = xxxx -- cantidad necesaria del item
local p = {
Position(x, y, z) -- Position of the item blocking the path
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local stone = Tile(p[1])
if item.itemid == 1945 then
if (player:removeItem(ItemID, Count) == true) then
player:sendTextMessage(MESSAGE_EVENT_ORANGE, 'The object in your path has been removed for ' .. timetoreset .. ' minutes.')
stone:getItemById(objectid):remove()
p[1]:sendMagicEffect(CONST_ME_POFF)
Item(item.uid):transform(1946)
addEvent(function(stonePos)
Game.createItem(objectid, 1, stonePos)
stonePos:sendMagicEffect(CONST_ME_TELEPORT)
Tile(toPosition):getItemById(1946):transform(1945)
end, timetoreset * 60000, stone:getPosition())
else
player:sendCancelMessage("You do not have item.")
end
elseif item.itemid == 1946 then
return false
end
return true
end
Temas similares
Permisos de este foro:
No puedes responder a temas en este foro.
|
|