Yes other dumb question but the int value (wood) won't go into the inventory
here's the script
01 | script.Parent.ClickDetector.MouseClick:Connect( function (player) |
02 | if (player.Inventory:FindFirstChild( "Wood" )) then |
03 | player.Inventory:WaitForChild( "Wood" ).Value = player.Inventory:WaitForChild( "Wood" ).Value + 1 |
04 | elseif ( not player.Inventory:FindFirstChild( "Wood" )) then |
05 | local wood = Instance.new( "IntValue" , player) |
06 | wood.Name = "Wood" |
07 | wood.Value = 1 |
08 | end |
09 | script.Parent.Parent:Destroy() |
10 | end ) |
and there's no error in the output
You set the wood's parent to the player, not the Backpack. Also, you're supposed to use "Backpack", not "Inventory." Try this:
01 | script.Parent.ClickDetector.MouseClick:Connect( function (player) |
02 | if (player.Backpack:FindFirstChild( "Wood" )) then |
03 | player.Backpack:WaitForChild( "Wood" ).Value = player.Backpack:WaitForChild( "Wood" ).Value + 1 |
04 | elseif ( not player.Backpack:FindFirstChild( "Wood" )) then |
05 | local wood = Instance.new( "IntValue" ) |
06 | wood.Name = "Wood" |
07 | wood.Value = 1 |
08 | wood.Parent = player.Backpack |
09 | end |
10 | script.Parent.Parent:Destroy() |
11 | end ) |