I am trying to create a website like menu which when clicked opens a page and closes the other one
i.e. if someone is on the homepage. When they click on the button to take them to the about page, it will first close the homepage then open the about page.
I tried using a script which is using similar function but it did not work
Location of the script (Ignore the bad editing I just used the snip & sketch thingy)
The Variables
--Pages--
local Pages = script.Parent.Parent.Parent.MainFrame
local Home = Pages.HomeScreen
local About = Pages.AboutAdminify
local BanManager = Pages.BanManager
local Commands = Pages.ServerCommandsScreen
local Donate = Pages.DonateScreen
local Settings = Pages.SettingsScreen
local PrevPage
--Buttons--
local HomeBTN = script.Parent.HomeButton
local AboutBTN = script.Parent.AboutAdminify
local BanMangerBTN = script.Parent.BanManager
local CommandsBTN = script.Parent.Commands
local DonateBTN = script.Parent.Donate
local SettingsBtn = script.Parent.Settings
The Script
--Home Button--
HomeBTN.MouseButton1Click:Connect(function()
PrevPage.Visible = false
wait()
Home.Visible =true
PrevPage = Home
PrevPage.Visible = true
end)
--About Page--
AboutBTN.MouseButton1Click:Connect(function()
PrevPage.Visible = false
wait()
About.Visible =true
PrevPage = About
PrevPage.Visible = true
end)
--Ban Manager--
BanMangerBTN.MouseButton1Click:Connect(function()
PrevPage.Visible = false
wait()
BanManager.Visible =true
PrevPage = BanManager
PrevPage.Visible = true
end)
*I have purposely put those many variables since I was testing this script. I need all the variables tho