For i, v Double my print

As the video show my print “does +1” when I open and close my scrolling GUI I have no clue why it does this

Choose.MouseButton1Down:Connect(function()
print("Connect")
    if Choose.Text == "Cancel" then
        print("Animation Has Been Cancel")
        EmoteChoosed = ""
        Choose.Text = "Choose"
        SP.ScrollingFrame.Visible = false
        ListOpen = false

    elseif not ListOpen then
        ListOpen = true
        print("List Of Animation Has Beed Open")
        SP.ScrollingFrame.Visible = true
        Choose.Text = "Pick An Emote"

        for i, v in (SP.ScrollingFrame:GetChildren()) do
            if v:IsA("TextButton") then
                v.MouseButton1Down:Connect(function()
                    print("E")
                end)
            end
        end

    elseif ListOpen then
        ListOpen = false
        print("List Of Animation Has Beed Closed")
        SP.ScrollingFrame.Visible = false
        Choose.Text = "Choose"
    end
end)

Choose.MouseButton1Down:Connect(function()

may be ran twice somehow? (aka, clicking twice)

(which you never disconnect the for i,v in pairs functions that were created so it would have 2+ functions attached to one button click)

maybe try to run this before the

2 Likes

i got stuck on that for a good moment, you just found it really quickly thank you a lot !

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.