I am attempting to make a leader board that when you click a certain button in a Gui it adds a point. It isn't working and I don't know why...
players = game:GetService('Players')
startingcash = 0
-- Variables
players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue')
local cash = Instance.new('IntValue')
stats.Name = 'leaderstats'
cash.Name = 'Points'
cash.Parent = stats
cash.Value = startingcash
stats.Parent = plr
local AddPointGui = script.Parent.Parent.StarterGui.HandtoGui.Accept.Yes
AddPointGui.MouseButton1Click:connect(function()
cash.Value = cash.Value + 1
end)
end)
