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!
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)