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

Print wont work when i press my textbutton help?

local Button = game.StarterGui.ScreenGui.Frame.TextButton

Button.mouseclick1:Connect(function()
	print "hello im working)
end)

1 answer

✓ Accepted answer

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)

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