Hello Developer Forum!
Today while scripting UI I ran into the problem where when I pressed a button it was no longer showing the frame/window it was supposed to be. It was working before but am not quite sure what is causing the problem now. Below is the script that controls the UI buttons. Hope you guys can help and thanks for reading!
local replicatedStorage = game:GetService("ReplicatedStorage")
local starterRebirthAmount = 1000
local player = game.Players.LocalPlayer
local mainFrame = script.Parent:WaitForChild("MainFrame")
local rebirthMenu = mainFrame:WaitForChild("RebirthMenu")
local mainButton = script.Parent:WaitForChild("MainButton")
local rebirthButton = rebirthMenu:WaitForChild("RebirthButton")
local drinksToRebirth = rebirthMenu:WaitForChild("DrinksToRebirth")
local rebirths = player:WaitForChild("leaderstats").Rebirths
local menuButton = script.Parent:WaitForChild("MenuButton")
local menuFrame = script.Parent:WaitForChild("MenuFrame")
local serverStorage = game:GetService("ServerStorage")
local drinksFrame = script.Parent:WaitForChild("DrinksFrame")
local drinksButton = script.Parent:WaitForChild("DrinksButton")
local drinkMenu = drinksFrame:WaitForChild("DrinkMenu")
local drink1Equip = drinkMenu:WaitForChild("Drink1Equip")
local soda = serverStorage.Soda
mainButton.MouseButton1Click:Connect(function()
mainFrame.Visible = not mainFrame.Visible
end)
menuButton.MouseButton1Click:Connect(function()
menuFrame.Visible = not menuFrame.Visible
end)
drinksButton.MouseButton1Click:Connect(function()
drinksFrame.Visible = not drinksFrame.Visible
end)