i cant test it myself so please help me its suppose to find out who has the highest hidden stat.Points.Value and gives that player 1 player point
local pts= workspace.points pts.Changed:connect(function(prop) if pts.Value == true then print("works") local plrs={} local p={} for _,v in pairs(game.Players:GetPlayers()) do pcall(function() plrs[tostring(v.userId)]=v.hiddenstats.Points.Value table.insert(p,v.hiddenstats.Points.Value) print("work2") end) end local m=math.max(unpack(p)) for _,v in pairs(plrs) do if v==m then print("works3") pcall(function() game:GetService("PointsService"):AwardPoints(tonumber(1), 1) end) break end end end end)