hotscreen=script.Parent.hotscreen uglyscreen=script.Parent.uglyscreen while wait() do for i,v in pairs(game.Players:children()) do for i,v2 in pairs(v:children()) do for i,v3 in pairs(v:children()) do if v2.className=="NumberValue" then if v3.className=="NumberValue" then a=math.max(v2.Value) b=math.min(v3.Value) hotscreen.Image="http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..a.Parent.Name uglyscreen.Image="http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..b.Parent.Name end end end end end end
put your surfacegui in the workspace in the part. put the code in a serverscript
your code here:
local hotscreen = script.Parent.hotscreen local uglyscreen = script.Parent.uglyscreen local biggestValue = {} local lowerValue = {} game.Players.PlayerAdded:connect(function(player) local value = Instance.new("NumberValue",player) value.Name = "point" end) function Max(numbers) local last = {} while #numbers ~= 1 do wait() for index, value in pairs(numbers) do if type(value) == "number" then if numbers[index] and numbers[index + 1] and numbers[index] >= numbers[index + 1] then table.remove(numbers, index + 1) elseif numbers[index] and numbers[index - 1] and numbers[index] >= numbers[index - 1] then table.remove(numbers, index - 1) end else error("number unexpected !") end end end return tonumber(table.concat(numbers)) end function Min(numbers) local last = {} while #numbers ~= 1 do wait() for index, value in pairs(numbers) do if type(value) == "number" then if numbers[index] and numbers[index + 1] and numbers[index] <= numbers[index + 1] then table.remove(numbers, index + 1) elseif numbers[index] and numbers[index - 1] and numbers[index] <= numbers[index - 1] then table.remove(numbers, index - 1) end else error("Number unexpected !") end end end return tonumber(table.concat(numbers)) end while wait() do for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player") then biggestValue[i] = v:WaitForChild("point").Value lowerValue[i] = v:WaitForChild("point").Value end end for _, player in pairs(game.Players:GetChildren()) do if player:WaitForChild("point").Value == Max(biggestValue) then print(player.Name) hotscreen.Image = ("http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..player.Name) elseif player:WaitForChild("point").Value == Min(lowerValue) then print(player.Name) uglyscreen.Image = ("http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..player.Name) end end end