How do I prevent one frame from being visible when the other is visible? [SOLVED]

So, basically, I have two frames, and when 1 is visible I want to make sure you can’t make the other visible as well. How do I achieve this?

Ignore the Endings & Play button-

The credits and changelog button both make a frame appear in the same place. I just don’t want them to overlap.

That’s the changelog frame,

And that’s the credits frame.

That’s them overlapping.

You just set the visibility of the other frame to false.

E.g If the player selects credits → set the credit frame visible (true) and the change log visibility to false.

P.s you also misspelled credits as cedits

2 Likes

omg thank you so much😭 im an idiot i would have never noticed that! also how would i implement it into my script?

  • changelog script for example:
local TweenService = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local frame = script.Parent.Parent.ChangelogFrame
local frame2 = script.Parent.Parent.CeditsFrame

script.Parent.MouseButton1Click:Connect(function()
	frame.Visible = not frame.Visible
	local newpos = UDim2.new(0.255, 0,0.523, 0)
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)

	local tween = TweenService:Create(frame, tweenInfo, {Position = newpos})
	
	tween:Play()
end)
local TweenService = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local frame = script.Parent.Parent.ChangelogFrame
local frame2 = script.Parent.Parent.CeditsFrame -- Make sure u update this so its spelled right!!

script.Parent.MouseButton1Click:Connect(function()
	frame.Visible = not frame.Visible
    frame2.Visible = false -- We set the credit frame visibility to false!
	local newpos = UDim2.new(0.255, 0,0.523, 0)
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)

	local tween = TweenService:Create(frame, tweenInfo, {Position = newpos})
	
	tween:Play()
end)
1 Like

it works! thank you so much and also idk why I keep misspelling credits its actually killing me-- :smiling_face_with_tear:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.