Script error in my game

I got this error when I was trying to create the points script
image

script.AddPoints.OnServerEvent:Connect(function(plr)
	local strength = plr.leaderstats:FindFirstChild("Strength")
	strength.Value += 10
end)

This is the script
Please help me

There is no value in the leaderstats folder with the name “Strength”, could you also show the script that is supposed to create that value?

I searched but I did not create it if I have to where should I put it

You put the value in leaderstats

Hi, try this:

script.AddPoints.OnServerEvent:Connect(function(plr)
	local strength = plr.leaderstats:FindFirstChild("Strength")
	strength.Value = strength.Value + 10
end)

Hope it helps!

Strength.Value += 10 is the exact same as Strength.Value = Strength.Value + 10

1 Like