This works fine:
button = script.parent
function click()
print("hello")
end
button.MouseButton1Click:connect(click)
but this doesn't work?
function click()
print("hello")
end
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:connect(click)
This doesn't work too...
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:connect(function (click)
print("hello")
end)
in examples 2 and 3 script was not a child of the button TY

1 comment
Simple answer --> No