Jump to content

Train resouce


Recommended Posts

Hey there!

I'm making a resource for I suggestion I did on CIT and need to know something. How do I make a frieght train with 15 cars at LV north train station, drive to SF train station (anticlockwise) and disappear there?

Thanks in advance

Link to post

Would Be Better To Use

  
-- ServerSide Script 
addEventHandler("onResourceStart",getRootElement(), 
function () 
    local myTrain = createVehicle(537,1995,-1949,13)  -- Create the train 
    setTrainDirection(myTrain, true) -- Make the train drive clockwise 
        setTrainSpeed(myTrain, 1) -- Speed up 
end 
) 
  

Link to post

Using root will trigger for any resource start.

-- ServerSide Script 
addEventHandler("onResourceStart",resourceRoot, 
function () 
        local myTrain = createVehicle(537,1995,-1949,13)  -- Create the train 
        setTrainDirection(myTrain, true) -- Make the train drive clockwise 
        setTrainSpeed(myTrain, 1) -- Speed up 
end 
) 

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...