Porta com chave

players = game:GetService("Players")

script.Parent.Touched:connect(function(hit)

	local jogador = players:GetPlayerFromCharacter(hit.parent)
	
	local chaveItem = jogador.Backpack:FindFirstChild("Chave")
	if not chaveItem then
		chaveItem = hit.parent:FindFirstChild("Chave")
	end
	
	if chaveItem then

		script.Parent.Parent.Transparency = 1
		script.Parent.Parent.CanCollide = false
		chaveItem:Destroy()
	end
	
end)