Instancing a script from a MouseButton1Click connection in Plugins/Command Bar crashes studio

Repro: Copy and paste the following code into the command bar and run it, or create a plugin with the following code. Then click the TextButton that is created. It will cause studio to stop responding. Also I noticed that it only crashes when you parent the newly created script. If you keep it in nil it won’t crash.


local GUI = Instance.new("ScreenGui",game:GetService("CoreGui"))
local Button = Instance.new("TextButton",GUI)
Button.Size = UDim2.new(0,100,0,100)
Button.MouseButton1Click:connect(function()
	local Script = Instance.new("Script",workspace)
end)

I’m using Windows 10 and a friend on Windows 8.1 experiences the bug as well.

1 Like