Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I take a text in a GUI Textbox and put it in a stringvalue?

I'm trying to take the text of a player's textbox and put it into a StringValue. But, for some reason whenever I try to transfer the string, it wouldn't transfer. Trying to find the cause, I set the text to something random and the string worked and it went into the StringValue. I think for some reason when I try to transfer string that has been edited in the textbox it won't work. Do I have to enable/disable a property in the textbox?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StartingScreen = script.Parent.StartingScreen
local InformationScreen = script.Parent.InformationScreen
local StarterGUI = game.StarterGui
local TicketSystem = ReplicatedStorage.TicketSystem
local Values = TicketSystem.Values
local Inputs = InformationScreen.Inputs

	BI = Inputs.BoardingInput.Text
	CI = Inputs.CommentsInput.Text
	DI = Inputs.DateInput.Text
	DeI = Inputs.DestinationInput.Text
	GI = Inputs.GateInput.Text
	FI = Inputs.FlightInput.Text

function Confirmed()
	print("Confirmed Function")
	Values.BoardingV.Value = BI
	Values.CommentsV.Value = CI
	Values.DateV.Value = DI
	Values.DestinationV.Value = DeI
	Values.GateV.Value = GI
	Values.FLNumberV.Value = FI
	print(BI)
end

game.ReplicatedStorage.TicketSystem.TicketConfirm.OnServerEvent:Connect(Confirmed)

2 answers

Text values are already string values so there is no need to change it. You just cannot directly set values, you have to set it to a variable first.

 local boardingvalue =   Values.BoardingV -- You can set the value of the value if it is in a variable
 boardingvalue.Value = BI
    

This discussion is preserved as it was. New answers, comments, and votes are closed.