I've been working on th GUI for my game during the past few days and recently one of the buttons has stopped working (nothing happens when pressed). I would like to know what is wrong in the LocalScript and how I can fix it, or what else might be causing it.
I've done some testing using print() statements and the origin of the problem seems to be that the LocalScript is not detecting when the button is being clicked.
Here are all the parts fo the LocalScript that involve the button + what I used find the souce of the error.
local PlayTypeSelection = script.Parent.MainMenu local FreeroamSelect = PlayTypeSelection.GamemodeSelect.FreeroamFrame.FreeroamSelect local StageSelectionFrame = script.Parent.StageSelectScreen
local function ToggleMapSelect() if StageSelectionFrame.Visible == false then StageSelectionFrame.Visible = true PlayTypeSelection:TweenPosition(UDim2.new(0,0,0.5,0)) StageSelectionFrame:TweenPosition(UDim2.new(0.5,0,0.5,0)) wait(0.9) PlayTypeSelection.Visible = false else PlayTypeSelection.Visible = true StageSelectionFrame:TweenPosition(UDim2.new(1.5,0,0.5,0)) PlayTypeSelection:TweenPosition(UDim2.new(0.5,0,0.5,0)) wait(0.9) StageSelectionFrame.Visible = false end end
FreeroamSelect.MouseButton1Click:Connect(ToggleMapSelect)
FreeroamSelect.MouseButton1Click:Connect(function() print("this is not the source of the problem") end)
the last bit of the script did't print anythhing