I'm trying to make a grading system, and when I click "calculate" it always says "FAILED" and "0/100" and the value has not changed. Could use some help.
frame = script.Parent.Parent
score = frame.scoreval.Value
inter = frame.intersectionc.checked.Value
park = frame.parkingc.checked.Value
sharp = frame.sharpc.checked.Value
stop = frame.stopc.checked.Value
grammar = frame.grammarc.checked.Value
wide = frame.widec.checked.Value
function click()
script.Parent.Text = "CALCULATING"
if inter == true then
score = score + 20
end
wait(0.01)
if park == true then
score = score + 20
end
wait(0.01)
if sharp == true then
score = score + 10
end
wait(0.01)
if stop == true then
score = score + 15
end
wait(0.01)
if grammar == true then
score = score + 20
end
wait(0.01)
if wide == true then
score = score + 10
end
script.Parent.Text = "CALCULATE"
local finalscore = score
if finalscore >= 80 then
frame.pass.Text = "PASSED"
frame.score.Text = finalscore.."/100"
elseif finalscore < 80 then
frame.pass.Text = "FAILED"
frame.score.Text = finalscore.."/100"
end
end
script.Parent.MouseButton1Click:connect(click)

2 comments
You can get scores by, dividing the number of answers correct by the number of questions on the test. Then you multiply that number by the score. For example, you got 48/60 on a test. The max score is 600. The score you got is 480.
You could also do this by dividing the possible correct by the number they got correct then multiply by 100. If it was 40/50 point, you would do 40 Divided by 50, and get .8, then multiply that by 100, and it comes out to 80%