I've commented on my code below to give a better visualisation of my issue.

What happens is theres a frame, inside of the frame is a textbox and a textlabel.

When you enter the first few characters within the textbox if a name matches from the first few characters that are entered and a folder in workspace with a list of name the textlabel will change its text to that name, this works and all but why does it default to "GreenHarold" if its left blank? How would I just leave it blank instead of it defaulting to that name?


local text = script.Parent.TextBox --Where you write the characters of the name
local playerNames = game:GetService("Workspace").PlayerNames:GetChildren() --Temporary folder with parts that have different names.
local textdisplay = script.Parent.TextLabel --This Displays the name if it can find one that matches the characters entered

while wait() do  
    for i,v in pairs(playerNames) do
        if string.sub(v.Name,1, #text.Text) == text.Text then
            textdisplay.Text = v.Name
        end
    end
end