Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My simple gui textbox input system not working?

Asked by 4 years ago
Edited 4 years ago

I have a simple gui project that makes a user enter something in a textbox and when they click a button it will output on console. For some reason this dosen't work.

Script:

local textbox = script.Parent

local button = script.Parent.Parent.TextButton

button.MouseButton1Click:Connect(function()

      print("user entered:".. textbox.Text)
  

end)

It outputs nothing...

0
Script type? Ziffixture 6913 — 4y
0
What is your Script Type? RedstonecraftHD 25 — 4y

2 answers

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

Make sure you are using a local script.

0
Comment it, don't answer. VitroxVox 884 — 4y
Ad
Log in to vote
0
Answered by
3wdo 198
4 years ago

i see your problem. your using print to change the textbuttons text. so it would be

local textbox = script.Parent

local button = script.Parent.Parent.TextButton

button.MouseButton1Click:Connect(function()
    script.Parent.Text = "User Entered"
end)

or if you trying to print in the output, it would be

local button = script.Parent.Parent.TextButton

button.MouseButton1Click:Connect(function()
    print("User Entered")
end)

Answer this question