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

Why doesn't my MouseButton1Click function fire?

Asked by
Z0ggg 20
5 years ago
Edited 5 years ago

Ok so I made probably the most basic placeholder script for my UIs.

script.Parent.MouseButton1Click:Connect(function()
    print("entered!")
end)

The parent is a TextButton under a ScreenGUI in StarterGUI. Won't fire at all, even though it's just a print statement. Would appreciate some guidance here. Thanks in advance if you can help...

EDIT: I completely forgot that it needs to be local. That's what I get for stop using lua for 3 months.

0
Is it a local script or a server script? valchip 789 — 5y
0
server script Z0ggg 20 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

You need to use a LocalScript.

Ad

Answer this question