Hey y'all. Im bad at scripting and im trying to do so when you say something in the TextBox and click on a button. It shows it on a TextLabel. But this script doesnt work. Helping could be nice. Thanks!
local text = game.StarterGui.ScreenGui.Frame.TextBox local button = script.Parent local label = game.StarterGui.ScreenGui.Frame.TextLabel script.Parent.MouseButton1Click:Connect(function() if script.Parent.MouseButton1Click then label.Text = text.Text end end)
(Also for questions this is a localscript in the textbutton)
There's nothing wrong with the if statement, you can keep it if you want... the problem is in your variables, you can't use that path, instead, you should use a script.Parent...and so on Here's an example
local text = script.Parent.Parent.Frame.TextBox -- Check if correct local button = script.Parent local label = script.Parent.Parent.Frame.TextLabel -- Check if correct button.MouseButton1Click:Connect(function() if script.Parent.MouseButton1Click then label.Text = text.Text end end)
Make sure to correct path if it's not right
Hope this helped