Train system V 1.0 Venho Aqui Trazer Esse System bem Legal Com script script você só precisa adicionar um AID (no trem), e apenas adicionar o costume ferroviário!
Adicionar isso em actions.xml:
<action itemid="7131" event="script" value="railbymock.lua" /><action itemid="7132" event="script" value="railbymock.lua" />
E em railbymock.lua adicione:
--Script by mock the bear--Configlocal SPEED = 200local PLAYERSPEED = 250--Endlocal RAILS = {7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130} --Thxy rails itemid by nord :Plocal CART = {[0] = 7132, [2] = 7132, [3] =7131, [1] =7131}local CONFIG = {[7121] = 0,[7122] = 0,[7123] = {EAST, SOUTH},[7124] = {WEST, SOUTH},[7125] = {EAST, NORTH},[7126] = {WEST, NORTH},[7127] = 0,[7128] = 0,[7129] = 0,[7130] = 0,--Random}local reverse = {[0] = 2, 3, 0, 1} -- All that table was made by nord.local function moveTrain(cid, frompos, direc)local tabif not isPlayer(cid) thenreturnendlocal pos = getCreaturePosition(cid)local rar = findRail(pos)if not rar thendoPlayerSetNoMove(cid, false)doRemoveCondition(cid, CONDITION_OUTFIT)doChangeSpeed(cid, -PLAYERSPEED)doMoveCreature(cid, direc)elsetab = CONFIG[rar]if tab and type(tab) == 'table' thendirec = tab[tab[1] == reverse[direc] and 2 or 1] -- by nord hereenddoSetItemOutfit(cid, CART[direc], -1)doMoveCreature(cid, direc)addEvent(moveTrain, SPEED, cid, pos,direc)endendfunction findRail(p)local p_ = {x=p.x, y=p.y, z=p.z}for i=0,10 dop_.stackpos = ilocal t = getTileThingByPos(p_)if isInArray(RAILS, t.itemid) thenreturn t.itemid,t.uidendendendfunction onUse(cid, item, frompos) --Script by mock the bearif hasCondition(cid, CONDITION_OUTFIT) or (item.actionid < 500 and item.actionid > 503) thenreturn falseenddoTeleportThing(cid, frompos, false)doPlayerSetNoMove(cid, true)doChangeSpeed(cid, PLAYERSPEED)addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500)return trueend
Creditos: Autor: Mock Testado em: TFS 0.3.6