• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help action

Set correct pos, id, id, time

Code:
function onUse(cid, item, topos, frompos, itemEx)
 
    local pos, oldGround, newGround, time = {x=652, y=556, z=11, stackpos=0}, 355, 383, 1*60*1000
 
    local f = function()
        doTransformItem(getThingfromPos(pos).uid, oldGround)
    end
 
    local id = 100 -- action id of the ground
    if itemEx.actionid == id then
    doTransformItem(getThingfromPos(pos).uid, newGround)
        addEvent(f, time)
    end
    return TRUE
end
 
Last edited:
i try but no works help me in this script i need well time i want 1 minute of opem hole and tile i want use in tile id 355 to transform in id 383
position is x:652 y:556 z:11
 
i try but no works help me in this script i need well time i want 1 minute of opem hole and tile i want use in tile id 355 to transform in id 383
position is x:652 y:556 z:11

Edited previous post.

  • On your ground (355) set actionId to 100
  • save the code into a lua script in actions/scripts/
  • And in actions.xml you add this:
Code:
<action actionid="100" script="pick.lua"/>
alternative:
Code:
<action actionid="100" event="script" value="pick.lua"/>
 
Eh, rewrote it, hopefully working now:

Code:
function onUse(cid, item, topos, frompos, item2)
 
    local c = {
        Pos = {x=652, y=556, z=11, stackpos=0},
        oldGround = 355,
        newGround = 383,
        Time = 1*60*1000,
        ActionID = 100
    }
    local f = function()
        doTransformItem(getThingfromPos(c.Pos).uid, c.oldGround)
    end
 
    if item2.actionid == ActionID then
        doTransformItem(item2.uid, c.newGround)
        addEvent(f, c.Time)
    end
    return TRUE
end
 
one error in console

Lua Script Error : [ Action Interface ]
data/action/scripts/pick.lua:onUse

luaDoTransformItem<> . Item not Found
 
Back
Top