Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

MouseButton1Down not firing? [Found Problem]

Asked by 9 years ago

.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.

2 answers

Log in to vote
0
Answered by 9 years ago

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.

Ad
Log in to vote
-1
Answered by 9 years ago

try function mouseclicked() --code end script.Parent.Increase.SurfaceGui.TextButton.MouseButton1Click(mouseclicked)

0
Thats not it. I tested it just because why not and it didn't work. Also its .MouseButton1Click:connect(functionname). magiccube3 115 — 9y
0
woops yea forgot the :connect CodedEffects 10 — 9y

Answer this question