.Chatted
fires when I chat, but .MouseButton1Down
doesn't fire when clicked?
script.Parent.Increase.SurfaceGui.TextButton.MouseButton1Down:connect(function () print("1") --does not print print when clicked end) game.Players:WaitForChild("magiccube3").Chatted:connect(function (msg) print("2") -- prints when i chat print(msg) end)
Update: Caused by a line in another script enabling FilteringEnabled
.
Actually, I know this works in a new game I started making, last week, and is still in progress. I have buttons for all of my ingredients. However, when I do my testing, I always run it in server/client mode, and since the SurfaceGUIs are in the 3D world, controllable server-side, I have to switch over to the Server instance, for them to work - they never work in client. Are you sure this isn't what's happening - you're trying to test from the client?
Originally, I was making the mistake of trying to press the buttons in the client of studio, and thinking it was broke.
try function mouseclicked() --code end script.Parent.Increase.SurfaceGui.TextButton.MouseButton1Click(mouseclicked)