Menu is not working at all

I’m currently making a JToH (Juke’s Towers of Hell) Menu for my JToH Fangame. Here is the script:

local Menu = script.Parent.MenuFrame
local SettingsButton = Menu.SettingsButtonFrame.Button
local HelpButton = Menu.HelpButtonFrame.Button
local MenuButton = script.Parent.MenuButtonFrame.TextButton
local BackButton = Menu.ExitButton
local CurrentFrame = “None”
local AVIntensity = script.Parent:WaitForChild(“AVIntensity”)
repeat wait(0.1) until game.Players.LocalPlayer.PlayerScripts:FindFirstChild(“PlayerScripts”):FindFirstChild(“AudioVisualizer”)

BackButton.MouseButton1Click:Connect(function()
if CurrentFrame == “Main” then
CurrentFrame = “None”
Menu.Visible = false
Menu.HelpButtonFrame.Visible = true
Menu.SettingsButtonFrame.Visible = true
elseif CurrentFrame == CurrentFrame == “HelpMenu” or CurrentFrame == “SettingsMenu” then
CurrentFrame = “Main”
Menu.Visible = true
Menu.HelpButtonFrame.Visible = true
Menu.SettingsButtonFrame.Visible = true
Menu.SettingsMenu.Visible = false
Menu.HelpMenu.Visible = false
end
end)

script.Parent.MenuButtonFrame.TextButton.MouseButton1Click:Connect(function()
if CurrentFrame == “Main” then
CurrentFrame = “None”
Menu.Visible = false
elseif CurrentFrame == “None” then
CurrentFrame = “Main”
Menu.Visible = true
end
end)

HelpButton.MouseButton1Click:Connect(function()
CurrentFrame = “HelpMenu”
Menu.HelpButtonFrame.Visible = false
Menu.SettingsButtonFrame.Visible = false
Menu.SettingsMenu.Visible = false
Menu.HelpMenu.Visible = true
end)

SettingsButton.MouseButton1Click:Connect(function()
CurrentFrame = “SettingsMenu”
Menu.HelpButtonFrame.Visible = false
Menu.SettingsButtonFrame.Visible = false
Menu.SettingsMenu.Visible = true
Menu.HelpMenu.Visible = false
end)

Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.MouseButton1Click:Connect(function()
if Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text == “Low” then
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text = “Medium”
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.BackgroundColor3 = Color3.fromRGB(241, 255, 85)
AVIntensity.Value = 200
elseif Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text == “Medium” then
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text = “High”
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.BackgroundColor3 = Color3.fromRGB(255, 59, 33)
AVIntensity.Value = 120
elseif Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text == “High” then
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text = “Omg Why”
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.BackgroundColor3 = Color3.fromRGB(255, 0, 153)
AVIntensity.Value = 40
elseif Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text == “Omg Why” then
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text = “Off”
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.BackgroundColor3 = Color3.fromRGB(35, 39, 50)
AVIntensity.Value = 0
elseif Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text == “Off” then
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.Text = “Low”
Menu.SettingsMenu.AudioVisualizer.AudioVisualizer.BackgroundColor3 = Color3.fromRGB(168, 255, 121)
AVIntensity.Value = 300
end
end)

_G.QuickResetDelay=3

function UpdateQRSpeedButton()
local v=_G.QuickResetDelay
if v~=0 then
Menu.SettingsMenu.QuickResetSpeed.QRSpeed.Text=(tostring(v)…’ Second’…(v==1 and ‘’ or ‘s’))
else
Menu.SettingsMenu.QuickResetSpeed.QRSpeed.Text=‘Instant’
end
end
UpdateQRSpeedButton()
Menu.SettingsMenu.QuickResetSpeed.QRSpeed.MouseButton1Click:Connect(function()
if _G.QuickResetDelay<10 then
_G.QuickResetDelay=_G.QuickResetDelay+1
end
UpdateQRSpeedButton()
end)
Menu.SettingsMenu.QuickResetSpeed.QRSpeed.MouseButton2Click:Connect(function()
if _G.QuickResetDelay>0 then
_G.QuickResetDelay=_G.QuickResetDelay-1
end
UpdateQRSpeedButton()
end)

in the output, this error occurs which i dont understand: Screenshot 2021-05-23 211505

Screenshot 2021-05-23 211634

is the line of error

repeat 
   wait(0.1) 
until game.Players.LocalPlayer:WaitForChild(“PlayerScripts”):FindFirstChild(“AudioVisualizer”)

Could you please code block you code please. All you do is use this ``` in front of the the text and at the end.

1 Like

dont really know how to do that but ok
and i will try it

so i add ``` before until? or where

You add it at the start of your code and at the end. + You don’t need to send the entire script if the issue is only in the first couple of lines. If it was a error caused by something else in the script then by all means post it, but if not just code block the area where error occurs. Have a good day! Hope this helps.

1 Like

ohh so i add it before the first word of my script ok

okay, so i put ``` before the first word of my script, and ´´´ after the last word of my script. if it doesnt work, i will put it before the first word of the line of the error and after

didnt work. so i will try it with the line

Just ``` before and after, its the same symbol.

local Menu = script.Parent.MenuFrame
local SettingsButton = Menu.SettingsButtonFrame.Button
local HelpButton = Menu.HelpButtonFrame.Button
local MenuButton = script.Parent.MenuButtonFrame.TextButton
local BackButton = Menu.ExitButton
local CurrentFrame = “None”
local AVIntensity = script.Parent:WaitForChild(“AVIntensity”)
repeat wait(0.1) until game.Players.LocalPlayer.PlayerScripts:FindFirstChild(“PlayerScripts”):FindFirstChild(“AudioVisualizer”)

It’s quite simple just copy and paste this > ``` at the start and at the end of your code. Make sure nothing is connected to it.

( Players.JToHisveryfun.PlayerGui.Menu.MenuScript:1: Expected identifier when parsing expression, got '’ - Studio - MenuScript:1

uh

and yes i didnt connect it, i put a space between the ` and the word

Can you show more of the actual script? I don’t see where the error is. Also, thing I will reccomend is doing

local Players = game:GetService("Players") --instead of just game.Players

There is the reason for that.

Just try this:

repeat 
	wait(0.1) 
until game.Players.LocalPlayer:FindFirstChild(“PlayerScripts”):FindFirstChild(“AudioVisualizer”)