Trying to make dice, need some help

A way to (possibly) get this working is to attach parts to each face of the dice (if the dice is one mesh/part/union), name them accordingly, and get the part with the highest Y position.

This is assuming that the parts are children of the dice

wait(10) -- after both dice have been rolled
local d1temp = { 0, "None" } -- first is the Y value, 0 is the minimum. Set it below 0 if your dice is on a negative coordinate. Second is the name of the part attached to the face. Example: "Face2" for the number 2 face.
local d2temp = { 0, "None" } -- array for the second dice

for i,v in pairs(Dice.Dice1:GetChildren()) do
    if v.Position.Y > d1temp[1] then -- checks if Y position is higher that the current highest
        d1temp[1] = v.Position.Y -- sets the new highest record
        d1temp[2] = v.Name -- sets the name of the part. Example: "Face2"
    end
end
-- repeat for loop, this time for second dice using the second array
local d1highestname = d1temp[2] -- gets the name value
local d1highest = tonumber(string.sub(d1highestname, 5)) -- gets the digit from the name (Example name: "Face2")
-- repeat last block of code for second dice

That might work, I haven’t tested it yet. However, it is not the best solution.