im making a gui where you can type a brick name, and a text and it displays text on the selected brick using replicated storage.
function click()
local custom = script.Parent.Parent.CustomName.Text
local text = script.Parent.Parent.CustomText.Text
local part = game.Workspace[custom]
local part1 = workspace:FindFirstChild([custom].SurfaceGui)
if part1 then
custom:FindFirstChild("SurfaceGui")
end
game.ReplicatedStorage.SurfaceGui:Clone().Parent = workspace[custom]
game.Workspace[custom].SurfaceGui.TextLabel.Text = text
end
script.Parent.MouseButton1Click:Connect(click)
if you place a gui on a brick more than once, i want it to delete the old one. thats what the findfirstchild is for, then i will remove the first child. error was Expected identifier when parsing expression [ in line 7. its trying to find custom in the workspace. (which is a variable)
