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

[Requests] StepIn

Gregor

New Member
Joined
Feb 29, 2008
Messages
770
Reaction score
3
Location
UK/POLAND
Hello!
I need a script when you Step on id: "426" stone of id: "1354" will be remove and if you step out the stone It will retrieve again.

Thanks :)
 
\data\movements\script\stonetile.lua
Code:
down = getGlobalStorageValue(CHANGE)
stonePos = {x = 100, y = 100, z = 10, stackpos = 2}
getStone = getThingfromPos(stonePos)

function onStepIn(cid, frompos, topos)

    if item.actionid == CHANGE then
        if isPlayer(cid) == 1 then
            if down == 0 then
                doRemoveItem(getStone.uid,1)
                setGlobalStorageValue(CHANGE,1)
            end
        end
    end
end

function onStepOut(cid, frompos, topos)
    
    if item.actionid == CHANGE then
        if isPlayer(cid) == 1 then
            if down == 1 then
                setGlobalStorageValue(CHANGE,0)
                doCreateItem(1354,stonePos,1)
            end
        end
    end
end

movements.xml
Code:
    <movevent event="StepIn" actionid="CHANGE" script="stonetile.lua"/>
    <movevent event="StepOut" actionid="CHANGE" script="stonetile.lua"/>

Change all the "CHANGE" values!
 
Code:
down = getGlobalStorageValue(9999)
stonePos = {x = 541, y = 707, z = 10, stackpos = 2}
getStone = getThingfromPos(stonePos)

function onStepIn(cid, frompos, topos)

    if item.actionid == 9999 then
        if isPlayer(cid) == 1 then
            if down == 0 then
                doRemoveItem(getStone.uid,1)
                setGlobalStorageValue(9999,1)
            end
        end
    end
end

function onStepOut(cid, frompos, topos)
    
    if item.actionid == 9999 then
        if isPlayer(cid) == 1 then
            if down == 1 then
                setGlobalStorageValue(9999,0)
                doCreateItem(1354,stonePos,1)
            end
        end
    end
end
 
Back
Top