I want to know how to detect which player is closet to a part every second, then update an overhead name tag gui to say there position like
1st SpeedySanikJr
But when they are passed by robloxplaye6373, the passer will have the
1st robloxplayer6373
And now
2nd SpeedySanikJr
How do I do this?
This is what is meant by overhead name tag;
But I want the position number in front of the name, depending on how close they are to a part eg 1st, 2nd, 3rd
I know how to get the positions with this script:
local first = nil
local second = nil
local third = nil
local item = game.Workspace.apple
while true do
for i,v in pairs(workspace:GetChildren()) do
if v:FindFirstChild("HumanoidRootPart") then
if (v.HumanoidRootPart.Position - item.Position).Magnitude < 10 and first == nil then
first = (v.HumanoidRootPart.Position - item.Position)
elseif (v.HumanoidRootPart.Position - item.Position).Magnitude < 10 and v ~= first then
second = (v.HumanoidRootPart.Position - item.Position)
elseif (v.HumanoidRootPart.Position - item.Position).Magnitude < 10 and v ~= second and v ~= first then
third = (v.HumanoidRootPart.Position - item.Position)
end
end
end
wait(1)
end
But how do I organize and assign them to a players Build board Gui overhead name tag, based on there proximity to the apple?
Edit: should I create a whole new script, is this one effective at all? Is there a simpler way to do this?