I'm trying to make a basic counting script. What is wrong with this?
function Touched(SoccerBall) Workspace.ScoreBoard.Score1.Frame.RedScore.Text = 1 if Workspace.ScoreBoard.Score1.Frame.RedScore.Text == 1 then Workspace.ScoreBoard.Score1.Frame.RedScore.Text = 2 end end script.Parent.Touched:connect(Touched)
Well first off, you dont actually have a counter, you're just changing the text to 2 each time after it gets past one.
goals = 0 --Starting number of goals script.Parent.Touched:connect(function(SoccerBall)--firing the event goals = goals + 1 Workspace.ScoreBoard.Score1.Frame.RedScore.Text = goals end)