Unable to find tool keeps returning as nil

im making a key to open door script and when i try to check if the player has the key then it returns nil everytime even tho he has the key.

here is my script

prompt.Triggered:Connect(function(player)
	if Locked == true then
		print(player)
		print(player:FindFirstChild("Key1"))
		if player:FindFirstChild("Key1") then
			print(player)
			Locked = false
			prompt.ActionText = "Open"
			prompt.ObjectText = ""
		else
			return
		end
	end
end)
prompt.Triggered:Connect(function(player)
	if Locked == true then
		if player.Character:FindFirstChild("Key1") or player.Backpack:FindFirstChild("Key1") then
			Locked = false
			prompt.ActionText = "Open"
			prompt.ObjectText = ""
		else
			return
		end
	end
end)
1 Like

thank you so much