TextBox not accepting Text?

Hello Everyone,
I am not sure what has happened, but I cant seem to get the Text Property from a Textbox, and yes, I have tried this multiple times in multiple roblox places and it doesn’t work for me?, I have checked and when i try to print the Text all the script tells me is just “” , ive tried this on the client only, and still just “” this really has confused me, i have not done any modding to roblox studio itself, just the output of the Textbox is just “”

local SoundID = script.Parent.SouID.Text
local SoundVolume = script.Parent.VolSound.Text
local SoundSpeed = script.Parent.SpeedSound.Text

script.Parent.Play.TextButton.MouseButton1Click:Connect(function()
	print(SoundID)
	print(SoundVolume)
	print(SoundSpeed)
	script.Parent.Play.TextButton.Text = "Played Sound!"
	wait()
	Event:FireServer(SoundID,SoundVolume,SoundSpeed)
	wait(2)
	script.Parent.Play.TextButton.Text = "Play!"
end)

the problem here is that when i print (SoundID) or any other i just get this message even on JUST the client

problem2

i am extremely confused as there are no errors, just the Textbox not returning any Text, even though i typed something in the textbox

Again, i am extremely confused on what to do.

Do this instead:

script.Parent.Play.TextButton.MouseButton1Click:Connect(function()
local SoundID = script.Parent.SouID.Text
local SoundVolume = script.Parent.VolSound.Text
local SoundSpeed = script.Parent.SpeedSound.Text

	print(SoundID)
	print(SoundVolume)
	print(SoundSpeed)
	script.Parent.Play.TextButton.Text = "Played Sound!"
	wait()
	Event:FireServer(SoundID,SoundVolume,SoundSpeed)
	wait(2)
	script.Parent.Play.TextButton.Text = "Play!"
end)

The reason why its always “” is because you take the Text varbiable before the text is even set, thus returning “”

ok ill give it a try, probably a mistake on my end

Most likely because you define your text up here. Which in the beginning when everything loads in I assume is empty. This is a common error people make in their code, all you have to do is get rid of .Text so you only define the actual textboxs, then when you fire to the server and print, add .Text to the end. While the code BackspaceRGB provided also works, it is better to define just the textboxs at the top just incase you want to make other changes to them.

example:

local SoundID = script.Parent.SouID
-- other variables

script.Parent.Play.TextButton.MouseButton1Click:Connect(function()
	print(SoundID.Text)
    --code here
end)

Yea, you guys are all right, i just didnt realise that, sorry for any inconvenience, pretty funny mistake by me

Yes do what @BackspaceRGB put. The reason why you have the issue is because it is getting the different text right as the script is ran. Puting the verbal in when the button is clicked means it collects the text right when the button is clicked not at the start when the script runs which is what you want to collect the information which is required.

yea, i realise that now, thanks for the help