Right now I’m working on a gui score menu for my game. I am scripting the actual opener for the menu.
Say you opened the score menu, and are looking for your statistics for the candy land map(just made that up). Once you find the button to access the statistics, you click it, and brings you to it(its a different frame). After you looked at your statistics for the candy land map, you click the opener(instead of the back button) and the statistics disappear. You re-click the score opener, and it brings you to the candy land map statistics, where you left off.
My problem is it seems as though the main menu wont even appear, even though its properties says its visible and enabled. Even the script says in the output its visible:
local tweenService = game:GetService("TweenService")
local scores = starterGui:WaitForChild("Scores")
local mainMenu = scores.MainMenu
local debounce = false
local function findVisible()
for i,v in pairs(scores:GetChildren()) do
if v:IsA("ImageLabel") and v.Visible == true then
print(v.Name) -- prints what frame is visible
return v
end
end
end
script.Parent.MouseButton1Click:Connect(function()
if debounce == false then
debounce = true
if scores.Enabled == false then
scores.Enabled = true
local currentMenu = findVisible()
currentMenu:TweenPosition(UDim2.new(0.3, 0,0.125, 0), "Out", "Quint", 0.75,true)
wait(0.75)
debounce = false
elseif scores.Enabled == true then
local currentMenu = findVisible()
currentMenu:TweenPosition(UDim2.new(0.3,0,1.5, 0), "Out", "Quint", 0.75,true)
wait(0.75)
debounce = false
scores.Enabled = false
end
end
end)
--{0.3, 0},{0.125, 0}
I have picture of it too:
If you cant read my horrible writing, the output says its visible, its properties says its visible, and its in the correct position. Its Enabled too:
The reason why I didn’t file this as a bug was because I just wanna check and see if anyone can point out any errors in this script. There is nothing in front of the frame, and I have no plugins.
Have a great day!