Inventory Tools not appearing

why do the items not appear

dw about the data store and everything

but at the end, it clearly says “tool.Parent = plr.Backpack”
ITEMS ARE PRINTED AT THE FOR LOOP

for i,veee in pairs(plr.Backpack:GetChildren()) do
	print(veee.Name .. ' is in backpack')
end

NOTHING IS IN THE BACKPACK. HELP PLEASE I BEEN WORKING ON THIS FOR 5 DAYS
AND FOR SOME REASON THIS WORKS ON ROBLOX STUDIO BUT NOT ROBLOX

	if data['ItemTable'] then
		print('ItemTable is not nil')
		for i,v in ipairs(data['ItemTable']) do
			local foods = game.ReplicatedStorage.food:GetChildren()
			print('Checkinggfood for loop')
			print(v)
			for i,food in pairs(foods) do
				print(food.Name)
				print('Entering food for loop')
				print(v.. '. Comparison: ' .. tostring(food.Name))
				if v == food.Name then
					print('creating tool')

					
					
					local tool = Instance.new('Tool')
					local itemclone = food:Clone()
					tool.Name = food.Name
					itemclone.Name = "Handle"
				itemclone.Parent = tool
					itemclone.Anchored = false
					tool.Parent = plr.Backpack
					itemclone.take:Destroy()
					itemclone.Parent = tool
					module.ItemUse(itemclone.LuckBooster.Value, tool, itemclone.Time.Value, plr)

for i,veee in pairs(plr.Backpack:GetChildren()) do
	print(veee.Name .. ' is in backpack')
end

				--	itemclone.Position = plr.Character.HumanoidRootPart.Position
			
				end
			end
		end

	else
		print('its nil rn')
	end
2 Likes

why u bully me i am now sad. very sad

no amiserable_man no errors appear.

2 Likes

why dont you add an extra print in the for loop

this would show* how many times it looped

ex:

print(i)
2 Likes

no errors appear and it works on roblox studio but not roblox

2 Likes

which foor loop if i may ask? if its the one of the backpack then it loops the number of items in backpack

2 Likes

this one, this would show if it reads any other tools

2 Likes

why dont you use if statements to check the tools is in backpack.

2 Likes

it literally says there are items in the backpack but there are none

2 Likes

Why are you cloning a handle into the tool? Just have a tool ready in ReplicatedStorage and clone that into the backpack.

2 Likes

why dont you drag your tools in replicatedStorage and then cloning it into your starterpack heres the script:

local tools = game.ReplicatedStorage.tools --Defining the tools in replicatedstorage
tools:Clone() --Cloning tools into starterpack
tools.Parent = game.Starterpack
1 Like

this works in roblox studio but not roblox

	for i,v in ipairs(data['ItemTable']) do
			local foods = game.ReplicatedStorage.food
			local tools = foods.tools
			print('Checkinggfood for loop')
			print(v)
			
			for i, tool in pairs(tools:GetChildren()) do
				if tool.Name == v then
					local newtool = tool:Clone()
					newtool.Parent = plr.Backpack
					
				end
			end
		end

Wont cloning it in the starterpack make EVERYONE have it?

skil isue.