I have a textbox that when I start out with something other than "Begin1," and then change it to "Begin1," doesn't work. It only works when I press "Test" with the text as "Begin1."
while true do wait() if game.StarterGui.Group.TextBox.Text == "Begin1" then script.Parent.Text = "Right face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) script.Parent.Text = "Left face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) script.Parent.Text = "About face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) end end
Your error is simple. The problem is you are calling on the TextBox
that is located in StarterGui
, and not the one that is located in your player. The easiest way to fix this, is to just replace StarterGui
with the PlayerGui
Here is an example:
local name = "" -- Just put your name here! while wait() do local plr = game.Players:FindFirstChild(name) if plr ~= nil then --This just makes sure the player is actually in the game local p_gui = plr.PlayerGui -- PlayerGui is the gui for each individual player in the game if p_gui ~= nil then if p_gui.Group.TextBox.Text == "Begin1" then script.Parent.Text = "Right face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) script.Parent.Text = "Left face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) script.Parent.Text = "About face!" wait(10) script.Parent.Text = "Eyes up front!" wait(10) end end end end
I hope this helped!