I have been trying to get this script to work, but so far it can only tell when another player is close to you, whenever i add the lines of code that take into account the amount of laps each player has, it doesnt work… this is the script so far
me = game.Players.LocalPlayer
dist = 200
Flag = Instance.new("ScreenGui",me.PlayerGui)
Flag.Name = "Blue Flag"
bg = Instance.new("ImageLabel",Flag)
bg.Size = UDim2.new(0,200,0,200)
bg.Position = UDim2.new(0.15, 0, 0.8, -100)
bg.Image = "http://www.roblox.com/asset/?id=397459039"
bg.BackgroundTransparency = 1
Flag.Enabled = false
laps = me.leaderstats.laps
while true do
wait()
for _,v in pairs(game.Players:GetPlayers()) do
if v.Name ~= me.Name then
if v.Character then
local tor = v.Character:findFirstChild("Head")
local lapsCompleted = v.leaderstats.laps.Value
if tor then
local di = (me.Character.Head.Position - tor.Position).magnitude
if di < dist then
if laps.Value < lapsCompleted then
Flag.Enabled = true
end
end
if dist < di then
Flag.Enabled = false
end
end
end
end
end
end