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

I need simple movement script

Uzzio

New Member
Joined
Jan 3, 2009
Messages
27
Reaction score
0
Hi Folks,

I need very simple movement script. I'll explain you:

When player stand on the floor (pos. x = 2035 y = 1599 z = 11), the bars (id 1546) will disappear from 2 places (x2032 y1703 z 11) and (x2039 y1703 z11).
And the most important thing!!! After 30 second the bars have to appear back

Can someone help me?
You can give whichever unique/action id to floor.
 
I got a poi script, edited it for you,
I have to go, I'll test if it works when I'll be home
local bars1Pos = {x=316, y=262, z= 15}
local bars2Pos = {x=316, y=263, z= 15}
flooruid = 45927
function tileChecker(pos)
local myTable = {}
if (type(pos) == 'table') then
for i = 1, 5 do
pos.stackpos = i
local thisID = getThingFromPos(pos).itemid
if thisID > 1 then
table.insert(myTable, thisID)
end
end
end
return #myTable > 0 and myTable or nil
end

local function findItem(pos, t)
if (type(pos) == 'table' and type(t) == 'table') then
for _i, i in ipairs(tileChecker(pos)) do
if isInArray(t, i) then
pos.stackpos = _i
ret = getThingFromPos(pos).uid
break
end
end
end
return ret
end

local function reCreate()
doCreateItem(1546, 1, bars1Pos)
doCreateItem(1546, 1, bars2Pos)
end

function onStepIn(cid, item, position, fromPosition)
if (item.uid == flooruid and isPlayer(cid) == TRUE) then
doRemoveItem(findItem(bars1Pos, {1546}))
doRemoveItem(findItem(bars2Pos, {1546}))
addEvent(reCreate, 30 * 1000)
end
return TRUE
end

edit:
works fine, not sure if function finditem and tilechecker is necessary, but I'm not an expert in lua, I just edited someone's script
 
Last edited:
Back
Top