I made a start menu for my game that works fine in test mode, but when I go to a normal game, it will not work, and the log gives me "Info is not a valid member of screenGUI", but it is. Can anyone help with this? (Info is a textlabel by the way)
local Player = game.Players.LocalPlayer
local Menu = script.Parent
local Play = Menu.Play
local About = Menu.About
local HasPressedPlay = false
local info = Menu.info
local Minimize = info.Minimize
local Back = Menu.Backing
function MouseEnterPlayButton()
Play.FontSize = "Size60"
end
function MouseLeftPlayButton()
Play.FontSize = "Size36"
end
function MouseEnterAboutButton()
About.FontSize = "Size60"
end
function MouseLeftAboutButton()
About.FontSize = "Size36"
end
function PlayGame()
if HasPressedPlay == false then
for i = 1, 40 do
if i <= 20 then
Play.Position = Play.Position + UDim2.new(0.05, 0, 0, 0)
end
if i >= 10 then
About.Position = About.Position + UDim2.new(0.05, 0, 0, 0)
Menu.Title.Position = Menu.Title.Position + UDim2.new(0.05, 0, 0, 0)
Menu.Version.Position = Menu.Version.Position + UDim2.new(0.05, 0, 0, 0)
end
if i == 40 then
Back.Visible = false
end
wait()
end
end
end
function Minimizeinfo()
info.Visible = false
end
function ShowAbout()
info.Visible = true
end
About.MouseButton1Down:connect(ShowAbout)
Minimize.MouseButton1Down:connect(Minimizeinfo)
Play.MouseButton1Down:connect(PlayGame)
Play.MouseLeave:connect(MouseLeftPlayButton)
Play.MouseEnter:connect(MouseEnterPlayButton)
About.MouseLeave:connect(MouseLeftAboutButton)
About.MouseEnter:connect(MouseEnterAboutButton)
-- 27, 42, 53

1 comment
You're looking for it before it's loaded, just add a :WaitForChild()