After moving the tool to the inventory, it is not shown in the slots

  1. What do you want to achieve? Keep it simple and clear!
    Clone a tool to the player’s inventory.

  2. What is the issue? Include screenshots / videos if possible!
    After cloning and moving a tool to the player’s inventory, it does not show up in the slots.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

local prompt = script.Parent
local eye = prompt.Parent.Parent.mainEye

local mainEye = game.ReplicatedStorage:WaitForChild("mainEye")

prompt.Triggered:Connect(function(plr)
	
	local char = plr.Character or plr.CharacterAdded:Wait()
	if char then
		local backpack = plr:FindFirstChildOfClass("Backpack")
		if backpack then
			local clonedEye = mainEye:Clone()
			clonedEye.Parent = backpack
			print(clonedEye.Parent)
		end
	end
	
end)

I would like to point out a redundancy. This is pointless considering you have

plr.CharacterAdded:Wait()

this should either be true or yield and then be true.

When you say it is not shown in the slots, are you using a custom inventory or the normal roblox inventory?

local prompt = script.Parent

local eye = prompt.Parent.Parent.mainEye

prompt.Triggered:Connect(function(plr)
	local clonedEye = game.ReplicatedStorage.mainEye:Clone()
        clonedEye.Parent = plr.Backpack
end)

I don’t understand: local eye = prompt.Parent.Parent.mainEye

Under assumption, mainEye would be the tool and is located inside of the prompt’s parent’s parent.
Though, I suggest that WaitForChild is used and that you check that the item is existent.

1 Like

oh ok i see / / / / / / / / / //

It’s redundant and not used. I cloned another tool before.

I already understood that character testing is pointless, but I had no choice but to do it.

can you explains more of your desire?

@fares14213 @seancool07777 And everyone who participated in this post. This is my mistake, since I moved the regular Part without placing it in the Tool.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.