Hi everyone I have made these scripts for giving you points when you click on the part but for some reason it ain’t working. Can someone help me with this?
LEADERBOARD SCRIPT
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“IntValue”)
leaderstats.Name = ‘leaderstats’
leaderstats.Value = 0
local Points = Instance.new(“IntValue”)
Points.Name = ‘Points’
Points.Value = 0
leaderstats.Parent = player
Points.Parent = leaderstats
end)
THE POINTGIVER PART"S SCRIPT
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local PlayerPoints = player.leaderstats.Points
PlayerPoints.Value = PlayerPoints + 1
end)