I have a tool shop gui and for some reason the script inside of the buy button doesnt work here is the script (it is ss)
local btn = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Sword = ReplicatedStorage:FindFirstChild("Noob Sword")
btn.MouseButton1Click:Connect(function(player)
if player.leaderstats.Currency.Value > 199 then
local tool = Sword:Clone()
tool.Parent = player.Backpack
end
end)

2 comments
I recommend using remote events for this kind of stuff
because by not using a remote event the tool will only equip and show locally