I've been at this for a while, but I don't seem to get it. It doesn't add +1 to the SP value, am I doing something wrong?
local text = script.Parent.Parent.Parent.Frame2.TextLabel
local PointsService = game:GetService("PointsService")
local button = script.Parent
button.MouseButton1Click:connect(function(Player)
text.Text = "+1 SP"
script.Parent.Sound:Play()
button.Position = UDim2.new(math.random(4), math.random(4), math.random(4))
Player.leaderstats.SP.Value = Player.leaderstats.SP.Value + 1
end)
Everytime I click the button, the message,
"16:25:22.013 - Players.meteorcrasher118.PlayerGui.ScreenGui.Frame.TextButton.Script:9: attempt to index local 'Player' (a nil value)"
keeps appearing.

3 comments
game.Players.LocalPlayer also works in local scripts.
Thanks! Works perfectly.
Feel free to accept the answer.