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

[Movements] Error in my script :( help

DVEagle

New Member
Joined
Aug 29, 2009
Messages
95
Reaction score
3
Location
PoLand
It's simple script but seems not for me ;/..
Error:
Code:
[Error - MoveEvents Interface] 
[08/01/2011 01:00:32] data/movements/scripts/greatquest/bars.lua:onStepIn
[08/01/2011 01:00:32] Description: 
[08/01/2011 01:00:32] (luaDoRemoveItem) Item not found

Script...:
Code:
function onStepIn(cid, item, pos)
    local bars_pos = {x=1001, y=1243, z=13}
    if item.uid == 2000 and isPlayer(cid) == TRUE then
        doRemoveItem(1547,bars_pos)
    end
    return true
end

function onStepOut(cid, item, pos)
    local bars_pos = {x=1001, y=1243, z=13}
    if item.uid == 2000 and isPlayer(cid) == TRUE then              
    doCreateItem(1547,bars_pos)
    end
    return true
end

Can someone rewrite this movement ? I don't know why i see this error i have fence on correct pos and it's correct id... I checked that 100 times.
 
This:
Lua:
local bars_pos = {x=1001, y=1243, z=13}
To this:
Lua:
local bars_pos = {x=1001, y=1243, z=13, stackpos = 1}
 
Code:
[09/01/2011 10:55:46] [Error - MoveEvents Interface] 
[09/01/2011 10:55:46] data/movements/scripts/greatquest/bars.lua:onStepIn
[09/01/2011 10:55:46] Description: 
[09/01/2011 10:55:46] (luaDoRemoveItem) Item not found

Same error :(...
 
try
Code:
function onStepIn(cid, item, pos)
    local bars_pos = {x=1001, y=1243, z=13}
    if item.uid == 2000 and isPlayer(cid) == TRUE then
local bars = getTileItemById(bars_pos, 1547)
        doRemoveItem(bars.uid)
    end
    return true
end

function onStepOut(cid, item, pos)
    local bars_pos = {x=1001, y=1243, z=13}
    if item.uid == 2000 and isPlayer(cid) == TRUE then              
    doCreateItem(1547,bars_pos)
    end
    return true
end
 
+rep it works.
But i have 2 more problems.
1. Floor don't change when i'm standing on it.
On this screen, Death Requiem is standing on floor that removes bar. And gm standing on normal floor, same floors but scripted floor doesn't changes
xxac.png


2. How to add more removeable bars? Could you add in this script 2 more examples of bar but in other pos?
 
2. How to add more removeable bars? Could you add in this script 2 more examples of bar but in other pos?
Lua:
local table = { --[tile.uniqueid] = fence.pos
    [2001] = {x=1001, y=1243, z=13},
    [2002] = {x=1021, y=1243, z=13},
    [2003] = {x=1041, y=1243, z=13},
end

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    return true, isPlayer(cid) and doRemoveItem(getTileItemById(table[item.uniqueid], 1547).uid)
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    return true, isPlayer(cid) and doCreateItem(1547, table[item.uniqueid])
end
XML:
<movevent type="StepIn" uniqueid="2001-2003" event="script" value="tile.lua"/>
<movevent type="StepOut" uniqueid="2001-2003" event="script" value="tile.lua"/>
 
Lua:
local table = { --[tile.uniqueid] = fence.pos
    [2001] = {x=1001, y=1243, z=13},
    [2002] = {x=1021, y=1243, z=13},
    [2003] = {x=1041, y=1243, z=13},
end

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    return true, isPlayer(cid) and doRemoveItem(getTileItemById(table[item.uniqueid], 1547).uid)
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    return true, isPlayer(cid) and doCreateItem(1547, table[item.uniqueid])
end
XML:
<movevent type="StepIn" uniqueid="2001-2003" event="script" value="tile.lua"/>
<movevent type="StepOut" uniqueid="2001-2003" event="script" value="tile.lua"/>

Best be not-having checks and getting console errors in case bars don't exist.
 
I don't understand it, where is uid of floor? Is it unneccesary?
+this error
Code:
[10/01/2011 22:13:38] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tile.lua)
[10/01/2011 22:13:38] data/movements/scripts/tile.lua:5: unexpected symbol near 'end'
[10/01/2011 22:13:38] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tile.lua:5: unexpected symbol near 'end'
 
Last edited:
This worked for me :
Lua:
local table = { --[tile.uniqueid] = fence.pos
    [2001] = {x=1001, y=1243, z=13},
    [2002] = {x=1021, y=1243, z=13},
    [2003] = {x=1041, y=1243, z=13},
end
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if isPlayer(cid) and doRemoveItem(getTileItemById(table[item.uniqueid], 1547).uid) than
    return true
end
return false
end
 
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if isPlayer(cid) and doCreateItem(1547, table[item.uniqueid]) than
    return true
end
return false
end
 
ok so i've added uniqueid 2000 of tile where i have to stand to delete bars and added this to movements.xml:
Lua:
	<movevent type="StepIn" uniqueid="2000" event="script" value="tile.lua" />
	<movevent type="Stepout" uniqueid="2000" event="script" value="tile.lua" />

then i put 2001-2003 uids to bars (or shall i put uids to tiles?) and nothing happens..
 
Back
Top