Hi! I am try to make a starter menu for a roblox game I am working on. But when I run the game, the output gives me this error: Syntax Error: (17,41) Expected identifier when parsing expression, got '=' I have tried using the logical operator “==” instead but that did not work either. This is my code:
local button = script.Parent
button.MouseButton1Click:Connect(function()
local gradience = button:WaitForChild("Gradience")
local chosengradience = button.Folder:WaitForChild("ChosenGradience")
local chosen = button.Chosen.Value
local category = button.Category.Value
local current = button.Parent.Current.Value
for i, v in pairs(button.Parent:GetChildren()) do
if v.ClassName == "TextButton" then
if v.Name ~= "Continue" then
if v:WaitForChild("Category").Value == category then
if v:WaitForChild("Chosen").Value == true then
v:WaitForChild("Chosen").Value = false
v:WaitForChild("Folder"):WaitForChild("Gradience").Parent = v
v:WaitForChild("ChosenGradience") = v:WaitForChild("Folder")
current = button.Name
end
end
end
end
end
gradience.Parent = chosengradience.Parent
chosengradience.Parent = button
end)
If it’s possible, could you please explain why I got an error and how I can fix it? Thanks, and have a great day!
button.Activated:Connect(function()
-- rest of code
local Array = button.Parent:GetChildren()
for i,v in Array do
if v:IsA("TextButton") and v.Name ~= "Continue") then
if v.Category.Value then
v.Category.Value = false
-- rest of code
end
end
end
end)