local Button = game.StarterGui.ScreenGui.Frame.TextButton Button.mouseclick1:Connect(function() print "hello im working) end)
Don't reference the button in StarterGui
. Reference it in PlayerGui
as that is the GUI that the player is currently interacting with. Children of StarterGui
are replicated to the player in PlayerGui
. There's also no event called mouseclick1. You probably meant MouseButton1Click
. Your last error is your print function. Make sure to add your beginning bracket and closing quotation.
local Button = game.Players.LocalPlayer.ScreenGui.Frame.TextButton Button.MouseButton1Click:Connect(function() print("hello I'm working") end)