• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Requesting a script..

furstwin

New Member
Joined
Aug 9, 2007
Messages
486
Reaction score
1
Location
Sweden
As the title says im requesting a script :P
I would be really glad if someone would fix it for me so here we go :P

Theres 2 statues in a room and when I use the statues they light on(+1 ID) and when I lighted both statues 3 stones will remove and I'll be able to walk into a portal, aswell, also when I Unlight one statue the stones will be back on their positions, even is 1 statue is still lighted. Hope you understand :)

Sincerely,
Furstwin.
 
Not 100% sure if this will work, but try it. Just change STONEID, STATUEID and the stonePos\statuePos to the values of your choice.

statue1.lua:

Code:
function onUse(item, frompos, topos)


    local statue1Pos = {x = 100, y = 100, z = 7}
    local statue2Pos = {x = 100, y = 100, z = 7}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 100, y = 100, z = 7}    
    local stone2Pos = {x = 100, y = 100, z = 7}    
    local stone3Pos = {x = 100, y = 100, z = 7}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == STATUEID then
        doTransformItem(getstatue1.uid, getstatue.itemid + 1)
        if getStatue1 == STATUEID then
            if getStatue2 == STATUEID then
                if getStone1 == STONEID and getStone2 == STONEID getStone3 == STONEID then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getstatue1.uid, getstatue.itemid - 1)
        if getStone1 < STONEID and getStone2 < STONEID getStone3 < STONEID then
            doCreateItem(STONEID,1,stone1pos)
            doCreateItem(STONEID,1,stone2pos)
            doCreateItem(STONEID,1,stone3pos)
        end
    end
    return TRUE
end

statue2.lua:

Code:
function onUse(item, frompos, topos)


    local statue1Pos = {x = 100, y = 100, z = 7}
    local statue2Pos = {x = 100, y = 100, z = 7}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 100, y = 100, z = 7}    
    local stone2Pos = {x = 100, y = 100, z = 7}    
    local stone3Pos = {x = 100, y = 100, z = 7}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == STATUEID then
        doTransformItem(getstatue2.uid, getstatue.itemid + 1)
        if getStatue1 == STATUEID then
            if getStatue2 == STATUEID then
                if getStone1 == STONEID and getStone2 == STONEID getStone3 == STONEID then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getstatue2.uid, getstatue.itemid - 1)
        if getStone1 < STONEID and getStone2 < STONEID getStone3 < STONEID then
            doCreateItem(STONEID,1,stone1pos)
            doCreateItem(STONEID,1,stone2pos)
            doCreateItem(STONEID,1,stone3pos)
        end
    end
    return TRUE
end
 
Last edited:
Didnt work :(


Code:
Lua Script Error: [Action Interface]
data/actions/scripts/statue1.lua:onUse

data/actions/scripts/statue1.lua:16: attempt to index local 'item' (a number val
ue)

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/statue2.lua:onUse

data/actions/scripts/statue2.lua:16: attempt to index local 'item' (a number val
ue)
statue1.lua
Code:
function onUse(item, frompos, topos)


    local statue1Pos = {x = 400, y = 108, z = 8}
    local statue2Pos = {x = 409, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getstatue1.uid, getstatue.itemid + 1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getstatue1.uid, getstatue.itemid - 1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end
Statue2.lua
Code:
function onUse(item, frompos, topos)


    local statue1Pos = {x = 400, y = 108, z = 8}
    local statue2Pos = {x = 409, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getstatue1.uid, getstatue.itemid + 1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getstatue1.uid, getstatue.itemid - 1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end
 
Statue 1
Code:
function onUse(cid, item, frompos, topos)


    local statue1Pos = {x = 409, y = 108, z = 8}
    local statue2Pos = {x = 400, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getStatue1.uid, getStatue1.itemid+1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getStatue1.uid, getStatue1.itemid-1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end

Statue 2
Code:
function onUse(cid, item, frompos, topos)


    local statue1Pos = {x = 409, y = 108, z = 8}
    local statue2Pos = {x = 400, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getStatue2.uid, getStatue2.itemid+1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getStatue2.uid, getStatue2.itemid-1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end
 
Last edited:
local statue1Pos = {x=400, y=108, z=8, stackpos=1}
local statue2Pos = {x=409, y=108, z=8, stackpos=1}

doTransformItem(getStatue1.uid, getStatue1.itemid+1)
 
Fast answer o,o
When it's unlighted it's 3697
When its lighted its 3698 :P

Okay, could you update your old post with the new script? :p



Statue 1
Code:
function onUse(cid, item, frompos, topos)


    local statue1Pos = {x = 409, y = 108, z = 8}
    local statue2Pos = {x = 400, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getStatue1.uid, getStatue1.itemid+1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getStatue1.uid, getStatue1.itemid-1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end

Statue 2
Code:
function onUse(cid, item, frompos, topos)


    local statue1Pos = {x = 409, y = 108, z = 8}
    local statue2Pos = {x = 400, y = 108, z = 8}
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)
    
    local stone1Pos = {x = 403, y = 121, z = 8}    
    local stone2Pos = {x = 404, y = 122, z = 8}    
    local stone3Pos = {x = 405, y = 123, z = 8}    
    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)    
    
    if item.itemid == 3697 then
        doTransformItem(getStatue2.uid, getStatue2.itemid+1)
        if getStatue1 == 3697 then
            if getStatue2 == 3697 then
                if getStone1 == 1354 and getStone2 == 1354 and getStone3 == 1354 then
                    doRemoveItem(getStone1.uid,1)
                    doRemoveItem(getStone2.uid,1)
                    doRemoveItem(getStone3.uid,1)
                end
            end
        end
    else
        doTransformItem(getStatue2.uid, getStatue2.itemid-1)
        if getStone1 < 1354 and getStone2 < 1354 and getStone3 < 1354 then
            doCreateItem(1354,1,stone1pos)
            doCreateItem(1354,1,stone2pos)
            doCreateItem(1354,1,stone3pos)
        end
    end
    return TRUE
end
 
Last edited:
Ehh isn't that the itemid of the statue? :S

Okay, tell me this:
Itemid of statue NORMAL.
Itemid of statue FIRE.

UID/ActionID of statue 1.
UID/ActionID of statue 2.


And what you got in actions.xml would be great too!
 
Ehh isn't that the itemid of the statue? :S

Okay, tell me this:
Itemid of statue NORMAL.
Itemid of statue FIRE.

UID/ActionID of statue 1.
UID/ActionID of statue 2.


And what you got in actions.xml would be great too!

You are making everything so complicated :)

Normal ID: 3697
Fire ID: 3698
Statue 1 UID: 3697
Statue 2 UID: 3698
;)
 
Nah, making it easier for you! xD


Alright, try this:
PHP:
local statue1Pos = {x=409, y=108, z=8, stackpos=1}
local statue2Pos = {x=400, y=108, z=8, stackpos=1}

local stone1Pos = {x=403, y=121, z=8, stackpos=1}
local stone2Pos = {x=404, y=122, z=8, stackpos=1}
local stone3Pos = {x=405, y=123, z=8, stackpos=1}

function onUse(cid, item, frompos, topos)

    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)

    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos)

    if item.uid == 3697 then
        local getStatue = getStatue1
    elseif item.uid == 3698 then
        local getStatue = getStatue2
    end

    if item.itemid == 3697 then
        doChangeItemid(getStatue)
        if findItem(3698, getStatue1.itemid, getStatue2.itemid) then
            if findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then
                doRemoveItem(getStone1.uid, 1)
                doRemoveItem(getStone2.uid, 1) 
                doRemoveItem(getStone3.uid, 1)
            end
        end
    elseif item.itemid == 3698 then
        doChangeItemid(getStatue, -1)
        if not findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then
            doCreateItem(1354, 1, stone1Pos)
            doCreateItem(1354, 1, stone2Pos)
            doCreateItem(1354, 1, stone3Pos)
        end
    end
    return TRUE
end

function doChangeItemid(item, value)
    doTransformItem(item.uid, item.itemid + value or 1)
end

function findItem(itemid, ...)
    for _, compareItemid in pairs(arg) do
        if compareItemid == itemid then
            return true
        end
    end
    return false
end

Edit: It's for both statues!
 
Last edited:
Ima try the script now :)

Edit: Didnt work

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/statue2.lua:onUse

data/actions/scripts/statue2.lua:43: attempt to index local 'item' (a nil value)
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/statue1.lua:onUse

data/actions/scripts/statue2.lua:43: attempt to index local 'item' (a nil value)

Code:
local statue1Pos = {x=409, y=108, z=8}
local statue2Pos = {x=400, y=108, z=8}

local stone1Pos = {x=403, y=121, z=8}    
local stone2Pos = {x=404, y=122, z=8}    
local stone3Pos = {x=405, y=123, z=8}    

function onUse(cid, item, frompos, topos)
    local getStatue1 = getThingfromPos(statue1Pos)
    local getStatue2 = getThingfromPos(statue2Pos)

    local getStone1 = getThingfromPos(stone1Pos)
    local getStone2 = getThingfromPos(stone1Pos)
    local getStone3 = getThingfromPos(stone1Pos) 
    
    if item.uid == 3697 then
        local getStatue = getStatue1
    elseif item.uid == 3698 then
        local getStatue = getStatue2
    end
    
    if item.itemid == 3697 then
        doChangeItemid(getStatue)
        if findItem(3698, getStatue1.itemid, getStatue2.itemid) then
            if findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then
                doRemoveItem(getStone1.uid, 1)
                doRemoveItem(getStone2.uid, 1)
                doRemoveItem(getStone3.uid, 1)
            end
        end
    elseif item.itemid == 3698 then
        doChangeItemid(getStatue, -1)
        if not findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then
            doCreateItem(1354, 1,stone1Pos)
            doCreateItem(1354, 1,stone2Pos)
            doCreateItem(1354, 1,stone3Pos)
        end
    end
    return TRUE
end 

function doChangeItemid(item, value)
    doTransformItem(item.uid, item.itemid +1)
end 

function findItem(itemid, ...)
    for _, compareItemid in pairs(arg) do
        if compareItemid == itemid then
            return true
        end
    end
    return false
end
 
Last edited:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/statue1.lua:onUse

data/actions/scripts/statue2.lua:44: attempt to index local 'item' (a nil value)


Lua Script Error: [Action Interface]
data/actions/scripts/statue2.lua:onUse

data/actions/scripts/statue2.lua:44: attempt to index local 'item' (a nil value)
 
Back
Top