Hello, I'm using this script:
local price = script.Parent.Parent.Price local tools = game.ReplicatedStorage:WaitForChild("Tools") local tool = script.Parent.Parent.ItemName local player = script.Parent.Parent.Parent.Parent.Parent.Parent script.Parent.MouseButton1Click:Connect(function() if player.leaderstats:findFirstChild("Money").Value >= price.Value then player.leaderstats:findFirstChild("Money").Value = player.leaderstats:findFirstChild("Money").Value - price.Value game.ReplicatedStorage.ShopBuy:FireServer(tool.Value) end end)
but when I click the button, the script take the money from the player but doesnt give the item in the player's inventory.
it might be that you haven't actually made the character equip the tool. this can be done like this:
local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:FindFirstChildOfClass("Humanoid") Humanoid:EquipTool(workspace.Tool)
More info can be found here