How can I parent this Open GUI Script to a Frame inside a different ScreenGui

Hello! How can I parent this script to a Frame that is located inside a different ScreenGui? Here is the script

script.Parent.MouseButton1Click:Connect(function()
	
	for _, v in pairs (script.Parent.Parent.Parent.Parent:GetChildren()) do
		if v:IsA("Frame") then
			for _, nV in pairs(v:GetChildren()) do
				if nV:IsA("TextButton") then
					for _, v2 in pairs(nV:GetChildren()) do
						if v2:IsA("Frame") then
							if v2 == script.Parent.Parent.Frame then
								v2.Visible = not v2.Visible
							else
								v2.Visible = false
							end
						end
					end
				end
			end
		end
	end

end)

I still want to use that script, but how can I make it parent to this Frame inside “ExclusiveCodes”

Any help will be appreciated! :slight_smile:

1 Like