while true do
for _, plr in pairs(game.Players:GetPlayers()) do
local CorrectResponses = plr.CorrectResponses.Value
local IncorrectResponses = plr.IncorrectResponses.Value
local TotalResponses = CorrectResponses + IncorrectResponses
local Accuracy = (CorrectResponses / TotalResponses) * 100
local minRatio = 1.0
local maxRatio = 6.0
local Ratio = CorrectResponses / (IncorrectResponses + CorrectResponses)
local ScaledRatio = minRatio + Ratio * (maxRatio - minRatio)
plr.leaderstats.Accuracy.Value = Accuracy
if plr.leaderstats.Ratio.Value > 0 then
plr.leaderstats.Ratio.Value = math.floor(ScaledRatio * factor + 0.5) / factor
end
if plr.leaderstats.Accuracy.Value < 60 then
plr.leaderstats.Rank.Value = "Learner"
else
for Rank, Data in pairs(AccuracyToRank) do
if math.clamp(plr.leaderstats.Accuracy.Value,Data[1],Data[2]) == plr.leaderstats.Accuracy.Value then
plr.leaderstats.Rank.Value = Rank
end
end
end
end
task.wait()
end
The scaledratio changes to something after the player gets a correct answer but it should stay at 1 if there is no correct answers