Okay, to start off I know next to nothing about Lua so I've been following a tutorial on how to make a main menu for my game and have been changing it to fit my case. SOMETHING I added broke the entire thing. Everything was going well, and it was working until I added a few lines of code that brought you to a "Trial Select" screen when you press play. I have no idea what is wrong with it or how to fix it due to not have any Lua experience and I just need some help fixing it. The scripts are below. Thank you!
The error I've been getting
"20:14:51.254 - Players.Westleys_Peaches.PlayerGui.Menu.MenuMain:143: Expected 'end' (to close 'function' at line 73), got "
Script #1 -SetGUISettings
--Services
local SG = game:GetService("StarterGui")
local SP = game:GetService("StarterPlayer")
local UIS = game:GetService("UserInputService")
local PLRS = game:GetService("Players")
local FT = 0
local function SetGUI()
SG:SetCoreGuiEnabled(Enum.CoreGuiType.All,false)
SG:SetCore("ResetButtonCallback",false)
UIS.ModalEnabled = true
print("Finished Setting GUI")
end
local Success,Error = pcall(SetGUI)
repeat
FT = FT + 1
wait(2)
Success,Error = pcall(SetGUI)
until FT == 5 or Success
if FT == 5 then
PLRS.LocalPlayer:Kick()
elseif FT~= 5 and Success then
warn("Success")
end
Script #2 -MenuMain
wait(5)
--Services
local Tween = game:GetService("TweenService")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
--SIdebar
local Sidebar = script.Parent:WaitForChild("Sidebar")
local PlayBtn = Sidebar:WaitForChild("Play")
local ShopBtn = Sidebar:WaitForChild("Shop")
local Title = Sidebar:WaitForChild("Title")
--GamePopup
local GamePopup = script.Parent:WaitForChild("GamePopup")
local Text1 = GamePopup:WaitForChild("Text1")
local Text2 = GamePopup:WaitForChild("Text2")
local Text3 = GamePopup:WaitForChild("Text3")
local Text4 = GamePopup:WaitForChild("Text4")
local Text5 = GamePopup:WaitForChild("Text5")
local Trial1 = GamePopup:WaitForChild("Trial1")
local Trial2 = GamePopup:WaitForChild("Trial2")
local Trial3 = GamePopup:WaitForChild("Trial3")
local Trial4 = GamePopup:WaitForChild("Trial4")
local Trial5 = GamePopup:WaitForChild("Trial5")
local Return = GamePopup:WaitForChild("Return")
--ShopPopup
local ShopPopup = script.Parent:WaitForChild("ShopPopup")
--Tweens
local SlideOutSide = Tween:Create(Sidebar,TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Position = UDim2.new(0,0,0,0)})
local SlideInSide = Tween:Create(Sidebar,TweenInfo.new(0.2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Position = UDim2.new(-0.3,0,0,0)})
local HoverOverPlayBtn = Tween:Create(PlayBtn,TweenInfo.new(0.3,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size = UDim2.new(1,0,0.1,0)})
local LeavePlayBtn = Tween:Create(PlayBtn,TweenInfo.new(0.3,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size = UDim2.new(1,0,0.09,0)})
local HoverOverShopBtn = Tween:Create(ShopBtn,TweenInfo.new(0.3,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size = UDim2.new(1,0,0.1,0)})
local LeaveShopBtn = Tween:Create(ShopBtn,TweenInfo.new(0.3,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size = UDim2.new(1,0,0.09,0)})
local GamePopin = Tween:Create(GamePopup,TweenInfo.new(0.3,Enum.EasingStyle.Sine),{Transparency = 0.5})
local ShopPopin = Tween:Create(ShopPopup,TweenInfo.new(0.3,Enum.EasingStyle.Sine {Transparency = 0.5})
local ShopPopout = Tween:Create(ShopPopup,TweenInfo.new(0.3,Enum.EasingStyle.Sine),{Transparency = 1})
local Text1In = Tween:Create(Text1,TweenInfo.new(0.3),{TextTransparency = 0})
local Text2In = Tween:Create(Text2,TweenInfo.new(0.3),{TextTransparency = 0})
local Text3In = Tween:Create(Text3,TweenInfo.new(0.3),{TextTransparency = 0})
local Text4In = Tween:Create(Text4,TweenInfo.new(0.3),{TextTransparency = 0})
local Text5In = Tween:Create(Text5,TweenInfo.new(0.3),{TextTransparency = 0})
local Trial1In = Tween:Create(Trial1,TweenInfo.new(0.3),{TextTransparency = 0})
local Trial2In = Tween:Create(Trial2,TweenInfo.new(0.3),{TextTransparency = 0})
local Trial3In = Tween:Create(Trial3,TweenInfo.new(0.3),{TextTransparency = 0})
local Trial4In = Tween:Create(Trial4,TweenInfo.new(0.3),{TextTransparency = 0})
local Trial5In = Tween:Create(Trial5,TweenInfo.new(0.3),{TextTransparency = 0})
local ReturnIn = Tween:Create(Return,TweenInfo.new(0.3),{TextTransparency = 0})
local ShopOpen = false
local FT = 0
SlideOutSide:Play()--PlayTween
local function TeleportToGame(GameID)
TeleportService:Teleport(GameID)
end
--PlayBtn
PlayBtn.MouseEnter:Connect(function()
HoverOverPlayBtn:Play()
end)
PlayBtn.MouseLeave:Connect(function()
LeavePlayBtn:Play()
end)
PlayBtn.MouseButton1Click:Connect(function()
GamePopin:Play()
SlideInSide:Play()
if ShopOpen then
ShopPopout:Play()
end
wait(0.5)
Sidebar:Destroy()
ShopPopup:Destroy()
local Success, Error = pcall(function()
TeleportToGame(4845271643)
end)
repeat
FT = FT + 1
wait(5)
Success, Error = pcall(function()
TeleportToGame(4845271643)
end)
until Success or FT == 1
if FT == 5 then
Players.LocalPlayer:Kick("Problem Joining Game")
elseif FT~= 5 and Success then
warn("Success")
end
Text1In:Play()
Text2In:Play()
Text3In:Play()
Text4In:Play()
Text5In:Play()
Trial1In:Play()
Trial2In:Play()
Trial3In:Play()
Trial4In:Play()
Trial5In:Play()
ReturnIn:Play()
--ShopBtn
ShopBtn.MouseEnter:Connect(function()
HoverOverShopBtn:Play()
end)
ShopBtn.MouseLeave:Connect(function()
LeaveShopBtn:Play()
end)
ShopBtn.MouseButton1Click:Connect(function()
if not ShopOpen then
ShopOpen = true
ShopPopin:Play()
wait(0.3)
for i,v in pairs(ShopPopup:GetDescendants())do
if v.IsA("TextLabel")then
v.Visible = true
end
end
else
for i,v in pairs(ShopPopup:GetDescendants())do
if v.IsA("TextLabel")then
v.Visible = false
end
end
ShopPopout:Play()
ShopOpen = false
wait(0.3)
end
end)

1 comment
what part of the script is broken?