Clicking TextButton won't output TextBox text

Hello. I’m trying to make a system where a player inputs numbers into a TextBox and clicks a button to print those numbers. Everything is in StarterGui and the script is Local.

local TextButton3 = script.Parent
local Players = game:GetService("Players").LocalPlayer.PlayerGui
local TextBox = Players.TextBox

	local playerNumber = (TextBox.Text)

pictures of explorer:

Any help and tips are appreciated.


You’re referring to your Textbox incorrectly. Instead of calling the ScreenGui “ChatBox1” and the Frame within it, you’re skipping both of those, which may cause an error. Replace your “TextBox” variable with the line of code below:

local Players = game:GetService("Players").LocalPlayer.PlayerGui
local TextBox = Players.ChatBox1.Frame.TextBox

Hope this helps.

Oops. I fixed the path and even then it doesn’t seem to print the input of the player. Could I just route the text from a TextBox function into a variable and then print the variable with a button press?

Right. Just came back to the problem a bit later and turns out I disabled client outputs in the output console. Oops

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.