I am trying to have a text box set the text of a text label in workspace. Every time I press the submit button, it puts text, but it is the text that is in the text box before I typed anything, which was no text at all. Is there any way to fix this problem? Thanks! My script is below.
local Gate = script.Parent.Parent.Parent.Parent.Gate.Value
function onClick()
game.Workspace["GateSet"..Gate].GateBG.TV.SurfaceGui.Frame.Destination.DESTVALUE.Text = script.Parent.Parent.NameBox.Text
script.Parent.Text = "Success!"
wait(2)
script.Parent.Text = "Submit"
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.MainMenu.Visible = true
end
script.Parent.MouseButton1Down:connect(onClick)

3 comments
What does script.Parent.Parent.Parent.Parent refer to?
Don't use MouseButton1Down, you should use FocusLost
script.Parent.Parent.Parent.Parent refers to the main frame of the GUI that holds all the frames (screens)