getLocalPlayer | Multi Theft Auto: Wiki Skip to content

getLocalPlayer

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gets the player element of the client running the current script.

Syntax

getLocalPlayer ( )

Code Examples

client

Example 1:This client side function outputs the player's current location to the console.

function outputLocalPlayerPosition()
-- get the local player's position
local px, py, pz = getElementPosition(localPlayer)
-- output it to the console
outputConsole("Your location: "..px.." "..py .." "..pz)
end

See Also