Skip to content

API > MLStation


MLStation⚓︎

MLStation inherits from Component

MLStation component provides a mean to attach players to another object. The most common use for this is creating a seat. When attached to the station, the player loses its movement abilities, but still can move their head and hands. Using the Lua, the player controller inputs can be accessed and used to drive vehicles.

Members⚓︎

Properties⚓︎

Name Description
MLStation.IsOccupiedProperty True if there is a player attached to the station. (Read only)
MLStation.LockProperty Sets or gets the station lock. If the station is locked, the players cannot enter or exit the station. While locked, a player still can be attached or detached to the station using Lua script.
MLStation.OnPlayerLeftPropertyReadonly Property Event that triggers when a player leaves (detaches) the station.
MLStation.OnPlayerSeatedPropertyReadonly Property Event that triggers when a player gets attached to the station.

Methods⚓︎

Name Description
MLStation.GetInput() Method Returns the current players controller inputs. Note that this function returns the controller inputs for the local player, so only the client which the current player is local can access the inputs.
MLStation.GetPlayer() Method Gets the MLPlayer object of current station occupant. Returns null if the station is empty.
MLStation.RemovePlayer() Method Removes (detaches) the current player from station if there is any.
MLStation.SettlePlayer(player) Method Attaches the given player to the station. Ignores if the station is occupied.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
MLStation.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
MLStation.tagPropertyReadonly Property The tag of this game object.
MLStation.transformPropertyReadonly Property The Transform attached to this GameObject.
MLStation.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
MLStation.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
MLStation.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
MLStation.CompareTag(tag)Method Is this game object tagged with tag ?
MLStation.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
MLStation.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
MLStation.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
MLStation.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
MLStation.GetComponents(type)Method Returns all components of Type type in the GameObject.
MLStation.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
MLStation.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
MLStation.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
MLStation.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
MLStation.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
MLStation.GetInstanceID()Method Returns the instance id of the object.