this is for make the weapon axe(a tool)
local Player = game.Players.LocalPlayer local ls = Player:WaitForChild("hiddenstats") local Scrap = ls:FindFirstChild("Scrap") local Rubber = ls:FindFirstChild("Rubber") local Plank = ls:FindFirstChild("Plank") local Tool = game.ReplicatedStorage.Axe script.Parent.MouseButton1Click:Connect(function() if Scrap.Value > 3 then if Plank.Value > 5 then Scrap.Value = Scrap.Value - 3 Plank.Value = Plank.Value - 5 Tool:Clone() Tool.Parent = Player.Backpack end end end)
this is for warn the player he or she have no items
local Player = game.Players.LocalPlayer local ls = Player:WaitForChild("hiddenstats") local Scrap = ls:FindFirstChild("Scrap") local Rubber = ls:FindFirstChild("Rubber") local Plank = ls:FindFirstChild("Plank") script.Parent.MouseButton1Click:Connect(function() if Scrap.Value < 3 then if Plank.Value < 5 then script.Parent.Text = "Not Enough Materials!" wait(1) script.Parent.Text = "Craft" end end end)
For the first script, lines 13 and 14 are the problem. You're cloning the tool, but it's not making it to the player's backpack because you didn't define the cloned tool.
local clone = Tool:Clone() clone.Parent = Player.Backpack
I assume that the price required is 3 scrap and 5 planks, so you just need to include an equal sign after the > in each if statement.
For the second script, you might consider combining the if statements so that if the player doesn't have enough scrap or enough plank, they can't buy it. Currently, your script only warns the player if they don't have enough of both.
if Scrap.Value < 3 or Plank.Value < 5 then --Not enough materials end