CreateWaypoint

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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(x, y, z, text)

Parameters

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

Return Value

  • Returns the waypoint identifier.

Example

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

See also