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

[Help] This script..

baioslaio

Hej svejs!
Joined
Sep 5, 2007
Messages
49
Reaction score
0
Location
Sweden
Lua Script Error: [MoveEvents Interface]
in a timer event called from:
data/movements/scripts/train1.lua:eek:nStepIn

attempt to index a number value
Code:
--Train System By Boy67 , This train is Traveling a ~40~ Sqm Rode to the Pos u choose ,See Below

function onStepIn(cid, item, pos)
cidd = getPlayerPosition(cid)
parameters = { cid = cid ,  uid = uid , item = item ,  moveTile = moveTile ,  moveTile2 = moveTile2 , sequence = sequence ,  move = move ,  move2 = move2 ,  move3 = move3 , thing = thing ,  teleport = teleport }

if item.itemid == 405 and item.actionid == 5001 then
cidd = getPlayerPosition(cid)
move = {x=cidd.x-1, y=cidd.y, z=cidd.z, stackpos=0} move2 = {x=cidd.x, y=cidd.y, z=cidd.z}
move3 = getThingfromPos(move)

local function moveTile(parameters)
cidd = getPlayerPosition(cid)
move = {x=cidd.x-1, y=cidd.y, z=cidd.z, stackpos=1} --The Direction of the "Train" x+1 is to the right-> x-1 is to the Left <- y-1 to north /\ y+1 to the South (notice that u gotta change Rails ids ;]
move2 = {x=cidd.x, y=cidd.y, z=cidd.z}
move3 = getThingfromPos(move)
doTeleportThing(cid,move)
create = doCreateItem(405,1,move)
doCreateItem(4833,1,move2)
doCreateItem(7122,1,move2)
doTeleportThing(cid,move)
doRemoveItem(move3.uid,1)
doSetItemActionId(create,5001)
end

local function Teleport2(parameters)
local pos = {x=321, y=145, z=8} --The pos where you Get Teleported in the end of the Rail
local tile = {x=321, y=143, z=8} --The pos where The ride Ends,For the "Train" to be deleted
local makepos = {x=361, y=143, z=8, stackpos=1} --The pos where The ride starts so it will make a new "Train" when u finish riding it
local find = getThingfromPos(makepos)
doTeleportThing(cid,pos)
doPlayerSendTextMessage(cid,22,"Thank you for riding Destiny's Railway Station") --Any message you want
doCreateItem(4833,1,tile)
doCreateItem(7122,1,tile)
make = doCreateItem(405,1,makepos)
doSetItemActionId(make,5001)
doRemoveItem(find.uid,1)
end

local function RemoveWall(parameters)
wallpos = {x=358, y=143, z=8, stackpos=2} --The pos where The "Stop" wall is placed
wall = getThingfromPos(wallpos)
doRemoveItem(wall.uid,1)
end

local function CreateWall(parameters)
cwallpos = {x=358, y=143, z=8} --Same pos as Wallpos
doCreateItem(7135,1,cwallpos)
end

addEvent(RemoveWall, 0, parameters)
addEvent(moveTile, 0, parameters)
addEvent(moveTile, 500, parameters)
addEvent(moveTile, 1000, parameters)
addEvent(moveTile, 1500, parameters)
addEvent(moveTile, 2000, parameters)
addEvent(CreateWall, 2500, parameters)
addEvent(moveTile, 2500, parameters)
addEvent(moveTile, 3000, parameters)
addEvent(moveTile, 3500, parameters)
addEvent(moveTile, 4000, parameters)
addEvent(moveTile, 4500, parameters)
addEvent(moveTile, 5000, parameters)
addEvent(moveTile, 5500, parameters)
addEvent(moveTile, 6000, parameters)
addEvent(moveTile, 6500, parameters)
addEvent(moveTile, 7000, parameters)
addEvent(moveTile, 7500, parameters)
addEvent(moveTile, 8000, parameters)
addEvent(moveTile, 8500, parameters)
addEvent(moveTile, 9000, parameters)
addEvent(moveTile, 9500, parameters)
addEvent(moveTile, 10000, parameters)
addEvent(moveTile, 10500, parameters)
addEvent(moveTile, 11000, parameters)
addEvent(moveTile, 11500, parameters)
addEvent(moveTile, 12000, parameters)
addEvent(moveTile, 12500, parameters)
addEvent(moveTile, 13000, parameters)
addEvent(moveTile, 13500, parameters)
addEvent(moveTile, 14000, parameters)
addEvent(moveTile, 14500, parameters)
addEvent(moveTile, 15000, parameters)
addEvent(moveTile, 15500, parameters)
addEvent(moveTile, 16000, parameters)
addEvent(moveTile, 16500, parameters)
addEvent(moveTile, 17000, parameters)
addEvent(moveTile, 17500, parameters)
addEvent(moveTile, 18000, parameters)
addEvent(moveTile, 18500, parameters)
addEvent(moveTile, 19000, parameters)
addEvent(moveTile, 19500, parameters) --Start Deleting "MoveTile" Events for shorter rode if so change the "Teleport2" number to the Last moveTile event Number +200 as it is right now
addEvent(Teleport2, 20000, parameters)
end
end
 
Check this:

Code:
--Train System By Boy67 , This train is Traveling a ~40~ Sqm Rode to the Pos u choose ,See Below

function onStepIn(cid, item, pos)
cidd = getPlayerPosition(cid)
parameters = { cid = cid ,  uid = uid , item = item ,  moveTile = moveTile ,  moveTile2 = moveTile2 , sequence = sequence ,  move = move ,  move2 = move2 ,  move3 = move3 , thing = thing ,  teleport = teleport }

if item.itemid == 405 and item.actionid == 5001 then
cidd = getPlayerPosition(cid)
move = {x=cidd.x-1, y=cidd.y, z=cidd.z, stackpos=0} move2 = {x=cidd.x, y=cidd.y, z=cidd.z}
move3 = getThingfromPos(move)

local function moveTile(parameters)
cidd = getPlayerPosition(cid)
move = {x=cidd.x-1, y=cidd.y, z=cidd.z, stackpos=1} --The Direction of the "Train" x+1 is to the right-> x-1 is to the Left <- y-1 to north /\ y+1 to the South (notice that u gotta change Rails ids ;]
move2 = {x=cidd.x, y=cidd.y, z=cidd.z}
move3 = getThingfromPos(move)
doTeleportThing(cid,move,0)
create = doCreateItem(405,1,move)
doCreateItem(4833,1,move2)
doCreateItem(7122,1,move2)
doTeleportThing(cid,move,0)
doRemoveItem(move3.uid,1)
doSetItemActionId(create,5001)
end

local function Teleport2(parameters)
local pos = {x=321, y=145, z=8} --The pos where you Get Teleported in the end of the Rail
local tile = {x=321, y=143, z=8} --The pos where The ride Ends,For the "Train" to be deleted
local makepos = {x=361, y=143, z=8, stackpos=1} --The pos where The ride starts so it will make a new "Train" when u finish riding it
local find = getThingfromPos(makepos)
doTeleportThing(cid,pos,0)
doPlayerSendTextMessage(cid,22,"Thank you for riding Destiny's Railway Station") --Any message you want
doCreateItem(4833,1,tile)
doCreateItem(7122,1,tile)
make = doCreateItem(405,1,makepos)
doSetItemActionId(make,5001)
doRemoveItem(find.uid,1)
end

local function RemoveWall(parameters)
wallpos = {x=358, y=143, z=8, stackpos=2} --The pos where The "Stop" wall is placed
wall = getThingfromPos(wallpos)
doRemoveItem(wall.uid,1)
end

local function CreateWall(parameters)
cwallpos = {x=358, y=143, z=8} --Same pos as Wallpos
doCreateItem(7135,1,cwallpos)
end

addEvent(RemoveWall, 0, parameters)
addEvent(moveTile, 0, parameters)
addEvent(moveTile, 500, parameters)
addEvent(moveTile, 1000, parameters)
addEvent(moveTile, 1500, parameters)
addEvent(moveTile, 2000, parameters)
addEvent(CreateWall, 2500, parameters)
addEvent(moveTile, 2500, parameters)
addEvent(moveTile, 3000, parameters)
addEvent(moveTile, 3500, parameters)
addEvent(moveTile, 4000, parameters)
addEvent(moveTile, 4500, parameters)
addEvent(moveTile, 5000, parameters)
addEvent(moveTile, 5500, parameters)
addEvent(moveTile, 6000, parameters)
addEvent(moveTile, 6500, parameters)
addEvent(moveTile, 7000, parameters)
addEvent(moveTile, 7500, parameters)
addEvent(moveTile, 8000, parameters)
addEvent(moveTile, 8500, parameters)
addEvent(moveTile, 9000, parameters)
addEvent(moveTile, 9500, parameters)
addEvent(moveTile, 10000, parameters)
addEvent(moveTile, 10500, parameters)
addEvent(moveTile, 11000, parameters)
addEvent(moveTile, 11500, parameters)
addEvent(moveTile, 12000, parameters)
addEvent(moveTile, 12500, parameters)
addEvent(moveTile, 13000, parameters)
addEvent(moveTile, 13500, parameters)
addEvent(moveTile, 14000, parameters)
addEvent(moveTile, 14500, parameters)
addEvent(moveTile, 15000, parameters)
addEvent(moveTile, 15500, parameters)
addEvent(moveTile, 16000, parameters)
addEvent(moveTile, 16500, parameters)
addEvent(moveTile, 17000, parameters)
addEvent(moveTile, 17500, parameters)
addEvent(moveTile, 18000, parameters)
addEvent(moveTile, 18500, parameters)
addEvent(moveTile, 19000, parameters)
addEvent(moveTile, 19500, parameters) --Start Deleting "MoveTile" Events for shorter rode if so change the "Teleport2" number to the Last moveTile event Number +200 as it is right now
addEvent(Teleport2, 20000, parameters)
end
end
 

Similar threads

Back
Top