How do i get user input from a text box

image
when a user types a rank in the button
it should give them that rank that they imputed

my problem is when i press the button it does not get the input

TextBox.Text stores the input. Although .Text must be referenced inside the click function(not at the top of the script) else it remains constant.

you you give me a sample script for a click function for this type of event please I’m still learning so i rely a lot on the dev forum could you give me a sample script for this

local TextBox = path.to.TextBox
local Button = path.to.Button

Button.Activated:Connect(function()
	local currentText = TextBox.Text
	print("Current text:", currentText)
end)

this is the original could you move to this one