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

How to "get" the text of a textbox? [[closed]]

I tried to make a "system" what prints what is the text of a textbox... It always returns nil Why? the localscript what not works

script.Parent.FocusLost:Connect(function()
local text = script.Parent.Text
	script.Parent.Parent.re:FireServer(text) --- this adds the text to the system, and prints it 
end)

there's the script what works

script.Parent.re.OnServerEvent:Connect(function(plr, messsage)
	print(plr.Name.." "..game.Chat:FilterStringAsync(messsage, plr, plr))
end)

1 comment

0

edited my answer.

2 answers

✓ Accepted answer

the variable in your script is incorrect, text is not script

local text = script.Parent.Text is the correct version, if the script's parent is a textbox.

6 comments

0

I tried but it not work

0

Without more code and details I'm afraid I cannot help

0

not works anyway

0

Do you know how parents work? script connects to the Explorer.

0

umm i am not a rookie

0

i had to edit this script

script.Parent.FocusLost:Connect(function()
local text = script.Parent.Text
    print(text)
end)

3 comments

0

Not works anyway

0

friend me discord, !raid6n#4965

0

I'll see if I can help.

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