This is a LocalScript which is inside of a TextButton.
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") local n = playerGui.OrderGui.Scroll.Name.TextBox.Text function leftClick() print("Left mouse click") playerGui.OrderGui.CurrentOrder.Text = "Vanilla Milkshake by "..n end script.Parent.MouseButton1Click:Connect(leftClick)
When I remove the ..n part it works fine, but nothing happens when I click the button when it has the ..n part in it.
(Excuse me as I was tired when I wrote this, I can go into further detail if you ask)
Hello!
While I'm not 100% familiar with Lua textboxes, I believe I see your issue.
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") function leftClick() local n = playerGui.OrderGui.Scroll.Name.TextBox.Text -- Move this inside the function so it gets updated to the textbox's current text. print("Left mouse click") playerGui.OrderGui.CurrentOrder.Text = "Vanilla Milkshake by "..n end script.Parent.MouseButton1Click:Connect(leftClick)
Because the TextBox was inside a frame called "Name," and "Name" is a property, that's what caused the issue.