Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

MouseButton1Click function not working?

Asked by 6 months ago

This code isn't working for no apparent reason.

No errors, no output. The code is in a LocalScript inside the TextButton.

local playButton = script.Parent -- "script.Parent" is a TextButton

playButton.MouseButton1Click:Connect(function()
    print("Clicked.")
end)
0
What script do you used? Script or LocalScript? HaveASip 494 — 6mo
0
If you used script, copy all this code and paste it in local HaveASip 494 — 6mo

1 answer

Log in to vote
0
Answered by
0lyxz 17
6 months ago

Try to use:

Function onClick()
Print("Clicked")
end

script.Parent.MouseButton1Click:Connect(onClick)
Ad

Answer this question