• 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!

Lua Looking for a poi script

vemvetvad

Banned User
Joined
Dec 19, 2016
Messages
214
Reaction score
139
Im looking for a script for poi for the hellfire and flamethrower room where the pulling of the lever removes the stone and also by walking on the tile upstairs you spawn the stone again,

im using nostalrius distro, thanks
 
Solution
Put an actionid on the lever, and on the tile you want to step on.

Install these scripts.

actions
XML:
<action actionid="45001" script="removestone.lua" />
Lua:
local stoneId = 1111
local stonePosition = Position(1111, 1111, 1)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local tile = Tile(stonePosition)
    if not tile then
        print("stonePosition is incorrect")
        return true
    end
    local stone = tile:getItemById(stoneId)
    if stone then
        stone:remove()
    end
    item:transform(item:getId() == 1946 and 1945 or 1946)
    return true
end
movements
XML:
<movevent event="StepIn" actionid="45001" script="createstone.lua" />
Lua:
local stoneId = 1111
local stonePosition =...

Don't rely on people's existing knowledge of a subject when requesting something.
I don't want to guess how the script is meant to work.
 
I dont understand how this can be hard to understand. Pulling a lever removes the stone that is already at the sqm in front of the stairs and if you walk across tile X the stone falls back.
What other information can I provide?
 
Put an actionid on the lever, and on the tile you want to step on.

Install these scripts.

actions
XML:
<action actionid="45001" script="removestone.lua" />
Lua:
local stoneId = 1111
local stonePosition = Position(1111, 1111, 1)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local tile = Tile(stonePosition)
    if not tile then
        print("stonePosition is incorrect")
        return true
    end
    local stone = tile:getItemById(stoneId)
    if stone then
        stone:remove()
    end
    item:transform(item:getId() == 1946 and 1945 or 1946)
    return true
end
movements
XML:
<movevent event="StepIn" actionid="45001" script="createstone.lua" />
Lua:
local stoneId = 1111
local stonePosition = Position(1111, 1111, 1)

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return true
    end
    local tile = Tile(stonePosition)
    if not tile then
        print("stonePosition is incorrect")
        return true
    end
    local stone = tile:getItemById(stoneId)
    if not stone then
        Game.createItem(stoneId, 1, stonePosition)
    end
    return true
end
 
Solution
Thanks! I see where I made a mistake and this was a valuable lesson for me. I appreciate your support and help, next time I will be more detailed in my requests.
 
Back
Top