I keep getting this error and I don't know how to fix it.
player = game.Players:GetPlayers()
script.Parent.MouseButton1Click:connect(function()
if player:findFirstChild('leaderstats') then
if player.leaderstats.Money.Value >= 500 then
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 500
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Start.Visible = true
else
script.Parent.Text = "Not enough money."
wait(3)
script.Parent.Text = "CONFIRM"
script.Parent.Parent.Visible = false
end
end
end)
ERROR: Workspace.Screen.SurfaceGui.Paying.TextButton.Script:4: attempt to call method 'findFirstChild' (a nil value)
BTW: I have tried 'findFirstChild' and 'FindFirstChild'.

3 comments
YOU COPIED MY ANSWER!
Come on man... not cool
I'm sorry :/. He asked me for help after reviewing your answer Lemon. Like I said in my answer, this isn't meant to be an answer, but a clarification.