FA
pedido

[Pedido] Passagem Secreta Diferente

Por Farathor, 13 de jul. de 2015 em Scripts

script
resolvido
16
3.3k
jvcasarinJ
15 de julho de 2015 às 16:29

 

Tinha esquecido de coloca uns negocio mas ta aqui.

 

Substitui o statueback por esse, não esqueça de configurar.

-- Do not remove the credits --
-- [MOVEMENT] Secret Teleport --
-- Developed by Rigby (João Vitor) --
 
    local fields = {1492, 1495} -- id do fire field e energy field
    local tile1 = {x = 1066, y = 1020, z = 7, stackpos= 1} -- Posição do tile 1
    local tile2 = {x = 1068, y = 1020, z = 7, stackpos= 1} -- Posição do tile 2
    local statue_Of_Position = {x = 1067, y = 1020, z = 7} -- posição onde fica a estátua, que ira aparecer o teleport
    local teleport = {x = 1066, y = 1020, z = 7} -- posição da onde o player vai quando entrar no teleport
    local go_Backward = {x = 1067, y = 1019, z = 7} -- Posição para aonde a estátua vai
    local statue = 3697 -- id da estátua
 
function onAddItem(cid, moveitem, tileitem, position)
    if getItemStack(go_Backward, statue) then
        if getItemStack(tile1, fields[1]) then
            doRemoveItem(getItemStack(tile1, fields[1]).uid, 1)
        elseif getItemStack(tile1, fields[2]) then
            doRemoveItem(getItemStack(tile1, fields[2]).uid, 1)
        elseif getItemStack(tile2, fields[1]) then
            doRemoveItem(getItemStack(tile2, fields[1]).uid, 1)
        elseif getItemStack(tile2, fields[2]) then
            doRemoveItem(getItemStack(tile2, fields[2]).uid, 1)
        end
    end 
end
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bem vindo.")
doTeleportThing(cid, teleport)
doCreateItem(statue, 1, statue_Of_Position)
    doRemoveItem(getItemStack(statue_Of_Position, 1387).uid, 1)
    doRemoveItem(getItemStack(go_Backward, statue).uid, 1)
return true
end
 
 
function getItemStack(pos, iid)
    for i = 1, 255 do
        posa = getThingFromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i})
        if posa.itemid == iid then
        return posa
        end
    end
return nil
end
e usa essa duas tag's
<movevent type="AddItem" tileitem="1" actionid="13501" event="script" value="statueback.lua"/>
<movevent type="StepIn" actionid="5555" event="script" value="statueback.lua"/>

 

 

Agora ta funcionando "normal", mas ainda tem um problema.

 

Eu uso essa passagem secreta 1 vez e beleza, quando eu vou usar dnv, eu clico na estátua não acontece nada e aparece a mensagem "You cannot use this object."

 

 

Ajuda ae plz