What im trying to do is take the TextButton and when you click it a textbox and the button disappears. my code is:
game.Players[p.name].PlayerGui.ScreenGui.Textbutton.MouseClick:connect(function(p) game.Players[p.name].PlayerGui.ScreenGui.TextButton.Visible = not game.StarterGui.ScreenGui.TextButton.Visible game.Players[p.name].PlayerGui.ScreenGui.TextBox.Visible = not game.StarterGui.ScreenGui.TextBox.Visible end)
Hey, I fixed your code to make it disappear but you had a lot of errors. 1, Some things were named differently. 2, It seems you are calling this from server which is not recommended. 3, I don't think you understand how PlayerGui and StarterGui work. I would suggest reading this for additional support: http://wiki.roblox.com/index.php?title=The_Fundamentals_of_Scripting_with_GUIs
game.Players[p.name].PlayerGui.ScreenGui.TextButton.MouseButton1Click:connect(function() game.Players[p.name].PlayerGui.ScreenGui.TextButton.Visible = false game.Players[p.name].PlayerGui.ScreenGui.TextBox.Visible = false end)
You've written a little too much code. It's as easy as placing the script inside a localscript.
I've also re-written your script for it to work.
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:connect(function() game.StarterGui.ScreenGui.TextButton.Visible = false game.StarterGui.ScreenGui.TextBox.Visible = true end)
Please accept my answer if this worked for you, if not, please leave a comment and i will get back to you ASAP.