Hello, I made a surfacegui shop and when you buy something, it connects to a remoteEvent that gives you the tool and takes away some points, but when I buy an item, my points count doesn't lower, and I get this in my output: ServerScriptService.Shop:14: attempt to perform arithmetic on field 'Points' (a userdata value). Does anybody know what this means and how to fix this?
--- this is a script in ServerScriptService
game.Players.PlayerAdded:Connect(function(p)
game.ReplicatedStorage.remoteEvent1.OnServerEvent:Connect(function()
game.ReplicatedStorage["Item1"]:Clone().Parent = p.Backpack
p.leaderstats.Points = p.leaderstats.Points - 25

3 comments
You are trying to do math on a instance which is not possible. You need to access the Value held. p.leaderstats.Points.Vaue = ect...
oh I see, I made that dumb mistake again
This is a common mistake for new users as well as using the default name of Value which would result as Value.Value