GUI button isn't working

Sorry if I look dumb right now, I’m having a simple issue where my script isn’t printing anything.
It is meant to check the team you’re on and then execute any code.

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.Parent.Parent.Parent.Team == "Team1" then
		print("hi")
	end
end)

Try using “if script.Parent.Parent.Parent.Parent.Parent.Team.Name == “Team1” then”

This worked, thanks for the help