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

Why is the mousebutton1click not working? [closed]

Asked by 5 years ago

This is my code:

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

The code is in a textbutton and the textbutton/gui is in a playergui which was cloned from the tool when equipped.

Whenever I try to click the button nothing happens. I checked my output and there is nothing.

Why is nothing happening?

0
Is in a server script User#24403 69 — 5y

Closed as Non-Descriptive by User#24403 and DinozCreates

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

Your script actually does work but, you forgot the extra parenthesis behind "end"

Also make sure you run it with a Local script

Here's the fixed script:

script.Parent.MouseButton1Click:Connect(function()
    print("E")
end)
Ad