Modding
Discord Wishlist on Steam

Library›People

Nearest player

fn/game.NearestPlayer

The player nearest to a place, how far off they are, and whether there is any player at all.

Nearest playerallatplayermetresfound
Does
An action: done when the run reaches it
Runs
On every machine
Listed under
Library › People
In a file
fn/game.NearestPlayer

Pins

  • inata position

    The place.

  • outplayera player movement

    The player.

  • outmetresa number

    How far round it, in metres.

  • outfoundyes or no

    Yes when there is one.

How it is made

Its body, as the bench opens it read-only. Copy into my mod on the bench makes a copy to change. The library's file is people.graph.json.

StartallatAll playersplayersFor eachlistLoop bodyDoneitemindexPosition ofofpositionDistanceabresultbestDistance<Branchconditiontruefalsebest =valuevaluebestDistance =valuevaluebestIs nothingvalueresultNOTReturnallplayermetresfound
Nearest player

Built from