Skip to content

Dropdowns dont update? #61

@0x-Offset

Description

@0x-Offset
local tools = {}
for _, c in game.Workspace.DroppedTools:GetChildren() do
    if c and c:FindFirstChild("MainAttach") and c.Name ~= "ToolCapture" and not table.find(tools, c.Name) then
        table.insert(tools, #tools+1, c.Name)
    end
end

local Dropdown = Tabs.Main:AddDropdown("Dropdown", {
    Title = "Dropped Tools",
    Values = tools,
    Multi = false,
    Default = "None",
})

game.Workspace.DroppedTools.ChildAdded:Connect(function(c)
    warn("dropped add "..c.Name)
    if c and c:FindFirstChild("MainAttach") and c.Name ~= "ToolCapture" and not table.find(tools, c.Name) then
        table.insert(tools, #tools+1, c.Name)
        task.wait()
        Dropdown:SetValues(tools)
    end
end)

game.Workspace.DroppedTools.ChildRemoved:Connect(function(c)
    warn("dropped rem "..c.Name)
    if table.find(tools, c.Name) then
        table.remove(tools, table.find(tools, c.Name))
        task.wait()
        Dropdown:SetValues(tools)
        if Dropdown.Value == c.Name then Dropdown:SetValue("None") end
    end
end)

i can see the dropped add and dropped rem in console, and in dex they show up just fine, so they're definitely there, but no matter what i do the list refuses to update, when they're removed they stay in the dropdown and when new ones get added they dont get added to the dropdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions