ContextActionService:GetButton() Returns Nil After 7th Button

local ContextActionService = game:GetService("ContextActionService")
local Inputs = {"a","b","c","d","e","f","g","h","i","j","k","l"}

for i = 1,10 do

    print(i)

    local function handleAction() end

    ContextActionService:BindAction("RandomName".. tostring(i),handleAction,true,Inputs[i])

    local Button = ContextActionService:GetButton("RandomName".. tostring(i))

    print(Button)

end

^ Test code
After using :BindAction() to create 8 or more buttons, :GetButton() starts returning nil instead of the button as you can see in the screenshot below. In the code above, different inputs is used with every BindAction call to demonstrate that the problem does not stem from binding too many actions to the same input. This is very problematic for games with a lot of buttons (such as Strucid).

image

3 Likes