This script is supposed to display the score on a practical test out of 8, it does the theory score fine but throws an error when doing the Practical Result. I've made sure that PracticalResult does have a value inside game.Players.Local player and yet I get the error: attempted to call field "Value" (a number value)
Help is much appreciated MD
function onClick() PracScore = game.Players.LocalPlayer.PracticalScore script.Parent.Parent.Visible = false script.Parent.Parent.Parent.OverallResult.Visible = true script.Parent.Parent.Parent.OverallResult.TheoryResult.Text = "You scored: "..script.Parent.Parent.Parent.Score.Value.." out of 10" script.Parent.Parent.Parent.OverallResult.PracticalResult.Text = "You scored: "..PracScore.Value " out of 8" -- error occurs here end script.Parent.MouseButton1Click:connect(onClick)
When you insert a value into a string, you need the periods on both sides.
Line 6:
script.Parent.Parent.Parent.OverallResult.PracticalResult.Text = "You scored: "..PracScore.Value.." out of 8"