SetWaypoint

From Onset Developer Wiki
SetWaypoint

Type: Function
Context: Client
Introduced: v1.0

Description

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

Syntax

SetWaypoint(slot, name, x, y, z)

Example Waypoint2.png

Parameters

  • slot
    Waypoint slot, this can be 1-3.
  • 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 true on success.

Example

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

See also

__EDIT_ME__