[Solved]
The button functions in the script is where it is broken, but I don't know what is wrong with it? Everything is named correctly..
This is what it should do... When you press one button, it closes all the other frames and only one frame should be visible (The frame linked to the button.)
How should I fix this and what is the problem?
--Club RoBeats Menu --IntellectualBeing --3/24/2014 ----------------------------------------------------------------- -----------[Main Variable Parents]----------- local Core = script --LOL local Main = script.Parent --The Mega Parent (Holds everything) local OpenM = script.Parent.OpenMenu --Button Frame local OpenB = OpenM.Open --Open Button local Content = script.Parent.MenuContent --Holds all the stuff local MenuTitle = script.Parent.Title --Pointless to have as a variable but okay. --[Player Variables]-- ----------------------------------------------------------------- --Open Menu + A tween! Left to right going fast to slow then do it in reverse when closing. --Button Functions local btnFrameCombos = { { button = Content:FindFirstChild("About"), frame = Content:FindFirstChild("AboutPage") }, { button = Content:FindFirstChild("Settings"), frame = Content:FindFirstChild("SettingsPage") }, { button = Content:FindFirstChild("Staff"), frame = Content:FindFirstChild("StaffPage") }, { button = Content:FindFirstChild("Inventory"), frame = Content:FindFirstChild("InventoryPage") }, { button = Content:FindFirstChild("Updates"), frame = Content:FindFirstChild("UpdatesPage") }, { button = Content:FindFirstChild("Songs"), frame = Content:FindFirstChild("SongsPage") }, { button = Content:FindFirstChild("Donate"), frame = Content:FindFirstChild("DonatePage") }, } local function showFrame(frame) for i,v in ipairs(btnFrameCombos) do v.frame.Visible = v.frame == frame end end for i,v in ipairs(btnFrameCombos) do v.button.MouseButton1Click:connect(function() showFrame(v.frame) end) end
The problem is here (Line 65 of your original code):
for i,v in ipairs(btonFrameCombos) do
It should be btnFrameCombos
, not btonFrameCombos
Just to remind you v.frame.Visible
is a boolean not an objectValue
instead of doing v.frame.Visible = v.Frame
do this v.frame.Visible = true
then copy the HideFrame()
function down below
function HideFrame() for i, v in ipairs(btnFrameCombos) do if v:IsA("Frame") then v.Visible = false end end end for i,v in ipairs(btonFrameCombos) do v.button.MouseButton1Click:connect(function() HideFrame() showFrame(v.frame) end) end
Locked by MrNicNac
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?