Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is the mousebutton1click not working?

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?

1 comment

0

Is in a server script

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.