sm.localPlayer
Local player represents the current character being controlled on the client's computer.
This library can only be used on the client.
For more information about other players in the world, see sm.player.
Functions
addRenderable
sm.localPlayer.addRenderable( file )
Client-Only
Adds a renderable (file containing model data) to be used for the local player in first person view.
Arguments:file
[ string ]: The path to the renderable file.
getActiveItem
sm.localPlayer.getActiveItem()
Client-Only
Returns the item currently held by the local player.
Returns:- [ Uuid ]: The uuid of the held item.
getAimSensitivity
sm.localPlayer.getAimSensitivity()
Client-Only
Returns the local player's aim sensitivity.
Returns:- [ number ]: The aim sensitivity.
getCarry
sm.localPlayer.getCarry()
Client-Only
Returns the local player's carrying container.
Returns:- [ Container ]: The player's carry.
getCarryColor
sm.localPlayer.getCarryColor()
Client-Only
Returns the color of the shape that the local player is carrying.
Returns:- [ Color ]: The player's carry color.
getDirection
sm.localPlayer.getDirection()
Client-Only
Returns the direction in which the local player is looking.
Returns:- [ Vec3 ]: The player's aim direction.
getFpAnimationInfo
sm.localPlayer.getFpAnimationInfo( name )
Client-Only
Returns general information for a first person view animation.
Arguments:name
[ string ]: The animation name.
- [ table ]: A table containing
name
,duration
andlooping
information of the animation.
getFpBonePos
sm.localPlayer.getFpBonePos( name )
Client-Only
Returns the world position for a bone in the first person view animation skeleton.
Arguments:name
[ string ]: The bone name.
- [ Vec3 ]: The bone position.
getHotbar
sm.localPlayer.getHotbar()
Client-Only
Returns the local player's hotbar container.
Returns:- [ Container ]: The hotbar.
getId
sm.localPlayer.getId()
Client-Only
Returns the local player's id.
Returns:- [ int ]: The id.
getInventory
sm.localPlayer.getInventory()
Client-Only
Returns the local player's inventory container.
Returns:- [ Container ]: The inventory.
getMouseDelta
sm.localPlayer.getMouseDelta()
Client-Only
Returns the delta position of the mouse.
Returns:- [ number ]: Mouse Delta X.
- [ number ]: Mouse Delta Y.
getOwnedLift
sm.localPlayer.getOwnedLift()
Client-Only
Returns the local player's lift.
Returns:- [ Lift ]: The lift.
getPlayer
sm.localPlayer.getPlayer()
Client-Only
Returns the local player's player object.
Returns:- [ Player ]: The player.
getPosition
sm.localPlayer.getPosition()
This function is deprecated.
Use sm.localPlayer.getPlayer().character.worldPosition
instead.
getRaycast
sm.localPlayer.getRaycast( range, origin, direction )
Client-Only
Performs a raycast relative to the local player's perspective.
Arguments:range
[ number ]: The maximum range.origin
[ Vec3 ]: The start position. Defaults tosm.localPlayer.getRaycastStart()
direction
[ Vec3 ]: The direction. Defaults tosm.localPlayer.getDirection()
- [ bool ]: Whether the raycast was successful or not.
- [ RaycastResult ]: The raycast result data.