I think I typed this right. But i keep getting a annoying error in the output. "leaderstats is not a valid member of player" even though it is a valid member of player.
local playerstats = game.Players.LocalPlayer.leaderstats.Coins
local playerstats2 = game.Players.LocalPlayer.leaderstats.Clicks
local aneeded = 1000
function exchange()
if playerstats2.Value >= aneeded then playerstats2.Value = playerstats2.Value - aneeded and playerstats.Value == playerstats.Value + 1
end
end
script.Parent.MouseButton1Click:Connect(exchange)

1 comment
maybe a game.Players.LocalPlayer.leaderstats:WaitForChild("Coins") Before the rest of the code may work