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

When i enter a somthing in a textbox it should print it but it just prints nothing why??

For example, I enter something and I made a variable called plrname and I try to print it is printed but the print is empty when I have entered text inside it why is that??

(for now, I'm just printing when you enter something to test it)

wait(1)
local status = script.Parent.Parent.status
local fire = game.ReplicatedStorage.Admin.Fireplr
local button = script.Parent
local remote = game.ReplicatedStorage.Admin.Fireplr
local plrname = script.Parent.Parent.PlrName.Text
button.MouseButton1Click:Connect(function()
	wait(1)
		print(plrname)
end)

Thank in advance!

1 answer

✓ Accepted answer

Hello.

You defined plrname outside of the event. So it will not update when you update the text.

Put plrname inside the event. Like this:

button.MouseButton1Click:Connect(function()
	local plrname = script.Parent.Parent.PlrName.Text
	print(plrname)
end)

2 comments

0

More accurately, he should define plrname to be the PlrName instance, and then print plrname.Text which will update

0

Thank You!

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