So, I made a button, and what i want it to do is there is a GUI on screen, and i want it that if you press the button, it hides the GUI on screen, and replaces it with another one. Like you start off with a GUI on screen that says something like 'Hello', and then when you press the button, the GUI changes and then the GUI says 'How are you?' (As an example)
Edit: I dont want to make a new GUI, like i made the two GUI's, i just need them to like switch places when you press a button. Like you start off with one, which has already some buttons and stuff in, but when you press a button, the first GUI disappears, and the second one appears. Then you press the button again, and you get the first GUI again.
Please help me out! I've tried everything I could think of!
You don't have to change whole gui you can just change the text of TextLabel
inside of it
local Player = game.Players.LocalPlayer local Label = Player.PlayerGui:WaitForChild("ScreenGui").TextLabel ExampleButton.MouseButton1Click:Connect(function() Label.Text = "How are you?" end)
Note: This will not be formated very well because I am ob phone
I'm thinking your wanting to make a dialog type thingy.
You may want to look into using tables to accomplish this...maybe something like this(did not test)
local textTable = {'Hi, John';'How are you today?';'Lolz don't care'} local key = 1 script.Parent.MouseButton1Click:Connect(function() script.Parent.TextLabel.Text = textTable[key] key = key + 1 end)
Something along those lines :)
if your wanting the textbox to disapear then use transparency or look into TweenPosition and such.
button1.MouseButton1Click:connect(function() GUI1.transparency = 1 GUI2.transparency = 0 end) button2.MouseButton1Click:connect(function() GUI1.transparency = 0 GUI2.transparency = 1 end)
It should work like this!