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)
What I would do
local player = game.Players.LocalPlayer local part = game.Workspace.SomePart local studsaway = 18 while true do if (player.Character.HumanoidRootPart.Position - part.Position).magnitude < studsaway then print("hey") end wait() end