Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Can someone help me see what's wrong with this script?

Asked by 9 years ago

I don't understand why this code does not work. It seems to be right. Please help, thank you! This script is supposed to change the color of a Billboard GUI Text when you click a certain color in a separate GUI. There is an error in line 56. It says it expected a ')' to close on line 38.

while not game.Players.LocalPlayer do
    wait()
end
while not Workspace:FindFirstChild(tostring(game.Players.LocalPlayer)) do
    wait()
end
Player = game.Players.LocalPlayer
character = Workspace:FindFirstChild(tostring(game.Players.LocalPlayer))
ColorUI = script.Parent:WaitForChild("ColorUI")
ColorsBox = ColorUI:WaitForChild("Main"):WaitForChild("Colors")
ColorButton = script.Parent:WaitForChild("ChangeColor")
RS = game:GetService("ReplicatedStorage")
GFiles = RS:WaitForChild("GuiFiles")
Rank = GFiles:WaitForChild("Rank")
RankFrame = Rank:WaitForChild("Frame")




function LoadColors()
    Colors = {1001,119, 24, 106, 21, 104, 23, 107, 37, 1002, 194, 199, 26, 1003, 1022, 105, 125, 153, 1023, 135, 102, 151, 5, 336, 1005, 101, 9, 11, 1018, 39, 1030, 1029, 1025, 1016, 1026, 1024, 1027, 1028, 1008, 1009, 1017, 1004, 1032, 1010, 1019, 1020, 217, 18, 38, 1031, 1006, 1013, 45, 1021, 192, 1014, 1007, 1015, 1012, 1011, 28, 141}
    LoadingColors = true
    local BuffLoadLimit = 10
    local CurrentLoad = 0
    local PrevPosition = UDim2.new(-0.1, 0, 0, 0)
    for Int,Color in pairs(Colors) do
        local NewColor = script:WaitForChild("ColorExample"):Clone()
        if PrevPosition.X.Scale >= (1 - 0.1) and PrevPosition.Y.Scale >= (1 - 0.1) then 
            LoadingColors = false
        elseif PrevPosition.X.Scale >= (1 - 0.1) then
            NewColor.Position = UDim2.new(0, 0, PrevPosition.Y.Scale + 0.1, 0)
        else
            NewColor.Position = PrevPosition + UDim2.new(0.1, 0, 0, 0)
        end
        NewColor.BackgroundColor3 = TextColor3.new(Color).Color
        NewColor.Parent = ColorsBox
        NewColor.Visible = true
        NewColor.MouseButton1Down:connect(function()
            print("User clicked button")
            local RankGui = Rank:WaitForChild("Frame")
            if RankGui == nil then return end
            print"Found gui"
            if RankGui:WaitForChild("Name1") ~= nil then
                local CurrentColor = Name1.TextColor3.Value
                print("Found color")
                for i,v in pairs(RankGui.Frame:WaitForChild("Name1")) do
                    if v.TextColor3.Value == CurrentColor.Value then
                        v.TextColor3 = TextColor3.new(Color)

                    end
                  end
                end
                Name1.TextColor3.Value = TextColor3.new(Color)
                ColorUI.Visible = false
              end  
            end)
        PrevPosition = NewColor.Position
        CurrentLoad = CurrentLoad + 1
        if CurrentLoad >= BuffLoadLimit then
            wait(0.001)
            CurrentLoad = 0
        end
    end
end

character.ChildAdded:connect(function(new)
    if new.Name == "Frame" then
        local Player = game.Players.LocalPlayer
        if Player and (Player.Name == "Buddy1926" or Player.Name == "Player1" then
            if new:FindFirstChild("Name1") ~= nil then
                script.Parent.ChangeColor.Visible = true
            end
        end
    end
end)

character.ChildRemoved:connect(function(new)
if not character:FindFirstChild("RankGui") then
script.Parent.ChangeColor.Visible = false
end
end)

ColorButton.MouseButton1Down:connect(function()
    ColorUI.Visible = true
end)

LoadColors()
0
If you want help, please tell us everything that this script is suppose to do. Tell us what's actually happening. Tell us any error (If any). alphawolvess 1784 — 9y
0
Well, this script is supposed to change the color of a Billboard GUI Text when you click a certain color in a separate GUI. There is an error in line 56. It says it expected a ')' to close on line 38. PresidentAlvarez 5 — 9y
0
In the question you need to include somewhat of what your trying to do instead of "Can someone help me see what's wrong with this script?" BSIncorporated 640 — 9y

1 answer

Log in to vote
0
Answered by
xPolarium 1388 Moderation Voter
9 years ago

To answer your error from the output: On line 38-56 you have to many end's, which is why you have the error. Just remove one of the ends, but remember to keep an ")" after one of them so they can close the function.

Also if you can next time not put the entire script but the part that you're having trouble with. Such as the error in the output. Also for the question title you should give a one sentence summary of your problem/script.

Ad

Answer this question