It's a shame I'm already back asking question but does anyone know how to fix this
Full Script
--------------- -- Constants-- ---------------- local DivisionsFrame = script.Parent.Parent.Divisions local UniformFrame = script.Parent.Parent.Uniforms local MorphDir = game.ReplicatedStorage.Morphs local Libs = game.ReplicatedStorage.Libs ----------------- --Main Code--- ----------------- for i, v in pairs (MorphDir:GetChildren () ) do local Button = Instance.new("TextButton") Button.Size = UDim2.new(1, 0, 0, 50) Button.BackgroundTransparency = 1 Button.Font = "GothamBlack" Button.TextSize = 25 Button.TextXAlignment = "Center" Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.Text = v.Name Button.Parent = DivisionsFrame Button.MouseButton1Click:connect(function () for i, v2 in pairs (UniformFrame:GetChildren () ) do if v2.ClassName == "Text Button" then v2:Destroy() end end end) for i, v3 in pairs (v:GetChildren () ) do for i, v3 in pairs (MorphDir:GetChildren () ) do local Button = Instance.new("TextButton") Button2.Size = UDim2.new(1, 0, 0, 50) Button2.BackgroundTransparency = 1 Button2.Font = "GothamBlack" Button2.TextSize = 25 Button2.TextXAlignment = "Center" Button2.TextColor3 = Color3.fromRGB(255, 255, 255) Button2.Text = v3.Name Button2.Parent = DivisionsFrame end end
--It's the end above thats the problem, I think...
Edit- Heres the output
Players.JustTwiggy.PlayerGui.MorphSelection.Scripts.LocalScript:54: Expected 'end' (to close 'do' at line 18), got <eof>; did you forget to close 'do' at line 38?
With everything and fixed indentations this is what is there. If this is not working as intended please let me know and we can further debug.
--------------- -- Constants-- ---------------- local DivisionsFrame = script.Parent.Parent.Divisions local UniformFrame = script.Parent.Parent.Uniforms local MorphDir = game.ReplicatedStorage.Morphs local Libs = game.ReplicatedStorage.Libs ----------------- --Main Code--- ----------------- for i, v in pairs(MorphDir:GetChildren () ) do local Button = Instance.new("TextButton") Button.Size = UDim2.new(1, 0, 0, 50) Button.BackgroundTransparency = 1 Button.Font = "GothamBlack" Button.TextSize = 25 Button.TextXAlignment = "Center" Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.Text = v.Name Button.Parent = DivisionsFrame Button.MouseButton1Click:connect(function() for i, v2 in pairs(UniformFrame:GetChildren()) do if v2.ClassName == "Text Button" then v2:Destroy() end end end) for i, v3 in pairs(v:GetChildren()) do for i, v3 in pairs(MorphDir:GetChildren()) do local Button = Instance.new("TextButton") Button.Size = UDim2.new(1, 0, 0, 50) Button.BackgroundTransparency = 1 Button.Font = "GothamBlack" Button.TextSize = 25 Button.TextXAlignment = "Center" Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.Text = v3.Name Button.Parent = DivisionsFrame end end end
The problem is that you forgot an end at the first for loop, so it should be:
--------------- -- Constants-- ---------------- local DivisionsFrame = script.Parent.Parent.Divisions local UniformFrame = script.Parent.Parent.Uniforms local MorphDir = game.ReplicatedStorage.Morphs local Libs = game.ReplicatedStorage.Libs ----------------- --Main Code--- ----------------- for i, v in pairs (MorphDir:GetChildren () ) do local Button = Instance.new("TextButton") Button.Size = UDim2.new(1, 0, 0, 50) Button.BackgroundTransparency = 1 Button.Font = "GothamBlack" Button.TextSize = 25 Button.TextXAlignment = "Center" Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.Text = v.Name Button.Parent = DivisionsFrame Button.MouseButton1Click:connect(function () for i, v2 in pairs (UniformFrame:GetChildren () ) do if v2.ClassName == "Text Button" then v2:Destroy() end end end) for i, v3 in pairs (v:GetChildren () ) do for i, v3 in pairs (MorphDir:GetChildren () ) do local Button2 = Instance.new("TextButton") Button2.Size = UDim2.new(1, 0, 0, 50) Button2.BackgroundTransparency = 1 Button2.Font = "GothamBlack" Button2.TextSize = 25 Button2.TextXAlignment = "Center" Button2.TextColor3 = Color3.fromRGB(255, 255, 255) Button2.Text = v3.Name Button2.Parent = DivisionsFrame end end end
Also fixed another error which you had, and put Button and then tried to define it as Button2
-Ducky
Developer
Youtuber