i need help... when i click the buy button the script doesn't work and doesn't take my money or give me the tool
local Remote = Instance.new("RemoteEvent",game:GetService("ReplicatedStorage"))
local tools = game.ReplicatedStorage:WaitForChild("Library")
Remote.OnServerEvent:Connect(function(player,price,tool)
local usercash = player.leaderstats:FindFirstChild("Cash")
if usercash.Value >= price then
usercash.Value = usercash.Value - price
tools[tool]:Clone().Parent = player.Backpack
end
end)

3 comments
I'm still not getting the tool... No errors or nothing :(
Make sure it is a local script
it still isn't seeming to work...