Difference between revisions of "CreateWaypoint"

From Onset Developer Wiki
(Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Creates a waypoint in the world. Distance is calculated automatically and shown to the player.}} {{FuncSyntax|CreateWaypoint(n...")
 
(No difference)

Latest revision as of 16:44, 29 November 2019

CreateWaypoint

Type: Function
Context: Client
Introduced: v1.0

Description

Creates a waypoint in the world. Distance is calculated automatically and shown to the player.

Syntax

CreateWaypoint(name, x, y, z)

Example Waypoint2.png

Parameters

  • name
    Text that appears on the waypoint. Pass an empty string to remove a waypoint.
  • x
    Coordinate X
  • y
    Coordinate Y
  • z
    Coordinate Z

Return Value

  • Returns the waypoint identifier.

Example

function OnKeyPress(k)
	if k == "K" then
		local x, y, z = GetPlayerLocation()
		CreateWaypoint("Saved Location", x, y, z)
	end
end
AddEvent("OnKeyPress", OnKeyPress)

See also