When I click the button to buy a sword, it doesn't say any errors or give me the sword.
script.Parent.MouseButton1Click:Connect(function()
game.Players.PlayerAdded:Connect(function(plr)
local RS = game:WaitForChild("ReplicatedStorage")
local library = RS:WaitForChild("Library")
local tool = library.ClassicSword
if plr.leaderstats.Cash.Value >= 1 then
print("enough")
local clone = tool:Clone()
clone.Parent = plr.Backpack
elseif plr.leaderstats.Cash.Value < 1 then
print("not enough")
end
end)
end)

2 comments
It should give you a syntax error because you never wrote 'end)' after 'game.Players.PlayerAdded:Connect(function(plr)'
ah, it did you're right, it still doesn't work though when I added it.