local name = script.Parent.Parent.ItemName
local resources = script.Parent.Parent.Resources
local itemgiven = script.Parent.Parent.ItemGiven
local wood = game.Players.LocalPlayer.rStats.WoodStat
local stone = game.Players.LocalPlayer.rStats.StoneStat
local cloth = game.Players.LocalPlayer.rStats.ClothStat
function craft()
--- BOW
if name.Text == "Bow" then
if wood.Value >= 50 then
wood.Value = wood.Value - 50
itemgiven.Text = "Bow given, check your inventory."
else
if wood.Value < 50 then
itemgiven.Text = "Bow not given, not enough wood."
end
end
--- PLEASE SELECT A ITEM
elseif name.Text == "Select a Item" then
print("Please Select a Item")
--- STONE HATCHET
elseif name.Text == "Stone Hatchet" then
if wood.Value >= 10 then
if stone.Value >= 40 then
wood.Value = wood.Value - 10
stone.Value = stone.Value - 40
itemgiven.Text = "Stone Hatchet given, check your inventory."
end
elseif wood.Value < 10 and stone.Value < 40 then
itemgiven.Text = "Stone Hatchet not given, not enough wood and stone."
elseif wood.Value < 10 and stone.Value >= 40 then
itemgiven.Text = "Stone Hatchet not given, not enough wood."
elseif wood.Value >= 10 and stone.Value < 40 then
itemgiven.Text = "Stone Hatchet not given, not enough stone."
--- WOOD HATCHET
elseif name.Text == "Wood Hatchet" then
if wood.Value >= 30 then
if stone.Value >= 10 then
wood.Value = wood.Value - 30
stone.Value = stone.Value - 10
print("Wood Hatchet Given")
end
end
end
end
end
script.Parent.Activated:Connect(function()
craft()
end)
Whats wrong with this script? Please tell me, also if you saw my last question and are annoyed that I'm asking questions this fast, I'm sorry, but I'm a begginer and I want to learn ASAP.

2 comments
Can you please tell me what this script does and what is being said in your output. If you could tell me where in your script the error is, or what the error is, that would make it convenient for me to assist to you.
@Vmena No error is popping out, this script is used for the Craft button of a Crafting GUI,my problem is that after running it once and for example getting wood, the script wouldn't run again.