how do i fix ')' (to close '(' at line 38), got '.'

Viewed 32
for i, v in pairs(Buttons:GetChildren()) do
    local NewItem = BoughtItems:FindFirstChild(v.Item.value)
    if NewItem ~= nil then
        Items[NewItem.Name] = NewItem:Clone()
        NewItem:Destroy()
    else
        v.ButtonPart.Transparency = 1
        v.ButtonPart.CanCollide = false
        v.ButtonPart.BillBoardGui.Frame.Visible = false 
    end
    
    if v:FindFirstChild("Dependency") then
        coroutine.resume(coroutine.create(function(
            v.ButtonPart.Transparency = 1
            v.ButtonPart.CanCollide = false
            v.ButtonPart.BillBoardGui.Frame.Visible = false
            if BoughtItems:WaitForChild(v.Dependency.Value, 100000)then
                v.ButtonPart.Transparency = 0
                v.ButtonPart.CanCollide = true
                v.ButtonPart.BillBoardGui.Frame.Visible = true
            end
        end))
    end
    
    v.ButtonPart.Touched:Connect(function(Hit)
        if Hit.Parent:FindFirstChild("Humanoid")then
            local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
            if Values.OwnerValue.Value == Player then
                if v.ButtonPart.CanCollide == true and v.ButtonPart.Transparency == 0 then
                    if Player:WaitForChild("leaderstats").Cash.Value >= v.Price.Value then
                        Player.leaderstats.Cash.Value -= v.Price.Value
                        Items[v.Item.Value].Parent = BoughtItems
                        v:Destroy()
                    end
                end
            end
        end
    end)
end

how do i fix this the header is the problem i dont knw what it means so is there a fix to it for my tycoon if anyone knows pls comment (heres some random stuff since my post is mostly code) A brief Introduction to Copypasta. Copypasta means to copy a text or a part of the text from an existing manuscript and inclusion of that very text in an under-process manuscript by pasting. At present, the societies are going to be expanded with an enormous pattern.

1 Answers

Parenthesis always come in pairs. The error message already strongly suggests that you are missing a closing parenthesis for an opening one in line 38.

                1                2        3
coroutine.resume(coroutine.create(function(
            v.ButtonPart.Transparency = 1
            v.ButtonPart.CanCollide = false
            v.ButtonPart.BillBoardGui.Frame.Visible = false
            if BoughtItems:WaitForChild(v.Dependency.Value, 100000)then
                v.ButtonPart.Transparency = 0
                v.ButtonPart.CanCollide = true
                v.ButtonPart.BillBoardGui.Frame.Visible = true
            end
        end))      <--- one is missing
          1 2

Use a text editor that autocompletes pairs or even better one that hightlights pairs in matching colors to avoid errors like this.

Related