Sorry if i havn’t posted this in the right section
I simply created a simple toggle button that opens / closes the “Avatar Context Menu”. The button works fine opening the menu but when i click on it again, i would have expected it to close because i was following this Avatar Context Menu | Documentation - Roblox Creator Hub
This is a LocalScript in the StarterGui:
local starterGui = game:GetService(“StarterGui”)
local button = script.Parent
button.MouseButton1Click:Connect(function()
if button.Text == “Enable ACM” then
starterGui:SetCore(“AvatarContextMenuTarget”, plr)
button.Text = “Disable ACM”
else
starterGui:SetCore(“AvatarContextMenuTarget”, nil)
button.Text = “Enable ACM”
end
end)
This is so interesting, so it says it has to be either false or nil, and if you set it to nil it errors. This is probably a bug maybe.
Does the ACM close even though there is an error?
Maybe then try enabling and disabling it
It’s a bug with SetCore itself. SetCore will always throw this error (right now at least, not sure if this has changed recently) if the second argument is nil.
Kinda weird, too, since the core script for the avatar context menu has a condition for player == nil…