Suitcase is not a valid member of player backpack when it is tho

My script:

> local partToLookFor = script.Parent.Parent.Parent.Parent.Teleporters.A
> local TeleportPosition = CFrame.new(script.Parent.Parent.Parent.Parent.Teleporters.B.Position)
> 
> 
> 
> game.Players.PlayerAdded:Connect(function(player)
> 	local Part = player.Backpack.Suitcase.detect
> 	Part.Touched:Connect(function(hit)
> 		if hit == partToLookFor then
> 			Part.CFrame = TeleportPosition
> 		end
> 	end)
> end)

I tried searching for topics like mine but nothing is helpful

The player has to equip it and have it on their character first.

Do I script that?

Just use if if player:FindFirstChild("Suitcase") then. This will detect if the player has their suitcase equipped.

can i talk another issue here?
image
im getting this error now

Actually I made a mistake, it’s if player.Character:FindFirstChild("Suitcase")

script.Parent.MouseClick:Connect(function(player)
local Item = player.Backpack:FindFirstChild(“Suitcase”)
Item.Parent = script.Parent.Parent.Parent.Detector
Item:FindFirstChild(“Handle”).CFrame = script.Parent.Parent.Conveyor.CFrame + Vector3.new(0,3,0)

--Make sure that everything is held together
for _, part in ipairs(Item:GetDescendants()) do
	if(part:IsA("BasePart") or part:IsA("MeshPart")) then
		part.CanCollide = true
	end
end
--

end)

my script

when its findfirstchild it cannot find the children of the suitcase @xMagmaDev

FindFirstChild basically means it will find the first thing named Suitcase. Use this instead:

Like this?

It doesnt have the part defined tho

Yeah Part is nil. The script doesn’t what “Part” is so it is returning it as nil.

What do i change part to? _______________________

local Part = (find the part using the dots)

I assume the “partToLookFor” is the part?

Change “Part” to:

partToLookFor.CFrame

Nope its the teleporter. __________________________

Alright, you need to define the Part then.

I dont understand this tho cuz suitcase is in backpack and the part is the suitcase

You removed the:

local Part = player.Backpack.Suitcase.detect

Put that back in.

Do i remove this 	local suitcase = player.Character:FindFirstChild("Suitcase")  ?