closest_player

Returns the closest player character from the given in distance and starting position

modules.closest_player(distance: number, starting_pos: Vector3)

Parameters

  • distance: The maxium distance in which the player can be found from the starting position

  • starting_pos: The starting position


Example

local starting_pos = game:GetService("Players").LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Position
local distance = 50

local closest = modules.closest_player(distance,starting_pos)

warn(closest)

Last updated