i think you have to close the local script so it gets published since you have team create on.
i don’t see your PlayerGui error in there
so as i said you may have to close your localscript in order for it to get published.
you should really use more variables so you could write cleaner code
you could also loop through LocalPlayer.PlayerGui and disable every Gui without having to do
Gui1.Enabled = false
Gui2.Enabled = false
Gui3.Enabled = false
local GameName = string.gsub(game.Name,"[%d%p]","")
script.Parent.MenuFrame.Title.Text = "Welcome to "..GameName
local frame: Frame = script.Parent.MenuFrame
-- Play button
script.Parent.MenuFrame.Play.MouseButton1Click:Connect(function()
script.Parent.MenuFrame.Visible = false
end)
-- Quit button
script.Parent.MenuFrame.Quit.MouseButton1Click:Connect(function()
game.Players.LocalPlayer:Kick("Rejoin !")
end)
if script.Parent:WaitForChild("MenuFrame").Visible == true then
for i, UI in ipairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if UI:IsA("ScreenGui") then
UI.Enabled = false
end
end
else
for i, UI in ipairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if UI:IsA("ScreenGui") then
UI.Enabled = true
end
end
end