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

[TFS 1.2] MoveEvent - multiple players remove item on StepIn, create back on StepOut

Unknown Soldier

Mapping a map
Joined
Oct 30, 2010
Messages
294
Solutions
11
Reaction score
665
Hi all!

I thought it would be easy but I just managed to create the script for 1 player, and im struggling how to edit it to work for few players.

So if 3 players in one time step on 3 specified SQMs (specified coordinates), an item blocking the way (also with specified coordinates) is removed. When at least one of the players steps out, blocking item comes back again.

Can anyone help?

Thanks in advance :)

nvm, solved...

Lua:
local pos1 = getThingPos(40034) --unique IDs of the floor
local pos2 = getThingPos(40035)
local pos3 = getThingPos(40036)

local entrancepos = {x = 2223, y = 1539, z = 11}
local monument = 1445

function onStepIn(cid, item, pos)
    if isPlayer(getTopCreature(pos1).uid) and isPlayer(getTopCreature(pos2).uid) and isPlayer(getTopCreature(pos3).uid) then
        doRemoveItem(getTileItemById(entrancepos,monument).uid)
    end
end

function onStepOut(cid, item, pos)
    if not isPlayer(getTopCreature(pos1).uid) or not isPlayer(getTopCreature(pos2).uid) or not isPlayer(getTopCreature(pos3).uid) then  
         if(getTileItemById(entrancepos, monument).uid < 1) then
            doCreateItem(monument, 1, entrancepos)
        end
    end
end
 
Last edited:
Back
Top