Any help will be appreciated :)
local camera = game.Workspace.CurrentCamera
local part = workspace.SomePart --Locate your part here
local studsAway = 18 --set how many studs you the player needs to be in range of
game:GetService("RunService").RenderStepped:connect(function()
if (camera.CoordinateFrame.p - part.Position).magnitude < studsAway then
--Part is the part in workspace, and it works fine with it. I just need help making it detect the Closest player within 10 studs
print("hey")
end
end)

1 comment
Can't tell why you are using camera for this.