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

Can't leave water

Hindori

New Member
Joined
Jan 24, 2009
Messages
157
Reaction score
2
Hmm now i need script to not can step out from water with storage. I'm trying somethink like this :
Lua:
function onStepOut(cid, item, pos, frompos)
 local water = {4820, 4821, 4822, 4823, 4824, 4825}
 for i = 1, 6 do
       if getPlayerStorageValue(cid, 63315) == 1 then
       if getTileItemById(pos, water[i]).uid > 0 then
            doTeleportThing(cid, frompos)
        else
return true
        end
    end
    return false
end
but it's crash my server.

I tried also :
Lua:
function onStepOut(cid, item, pos, frompos)
 local water = {4820, 4821, 4822, 4823, 4824, 4825}
           local f = getTileThingByPos(pos)
 for i = 1, 6 do
       if getPlayerStorageValue(cid, 63315) == 1 then
       if f.itemid ~= water[i].uid then
	               doTeleportThing(cid, frompos)
		 end
         end
return TRUE
end
end
but
[04/09/2011 01:54:20] [Error - MoveEvents Interface]
[04/09/2011 01:54:20] data/movements/scripts/woda1.lua:eek:nStepOut
[04/09/2011 01:54:20] Description:
[04/09/2011 01:54:20] data/movements/scripts/woda1.lua:26: attempt to index field '?' (a number value)
[04/09/2011 01:54:20] stack traceback:
[04/09/2011 01:54:20] data/movements/scripts/woda1.lua:26: in function <data/movements/scripts/woda1.lua:21>

Could anyone help?
 
Code:
<movevent type="StepOut" itemid="4820-4825" event="script" value="script.lua"/>

Lua:
local storage = 63315
function onStepOut(cid, fromPosition, toPosition)
	if getPlayerStorageValue(cid, storage) > 0 then
		doTeleportThing(cid, fromPosition, true)
	end
end
 
I think about it after i made this thread. But if it is only way i need to use it but without action id. I only want to use it when my map editor forget to made border or somethink like that. Thanks and rep. But if you find better way to made it plx msg.
 
Back
Top