So I'm trying to make something so when I type someones name the rest of the name would pop up
So if i type Bob in the textbox it would check if the player was in the server, if the player is then it would replace the textbox text with the full username
if i put hi but the full username was hiimbob then it would replace the text with hiimbob
heres a pic of what i mean https://cdn.discordapp.com/attachments/511168067515187211/586974531386736643/unknown.png when u type the d u can see the full username
if anyone can help then thanks
First, we should check if the person is in the server when we press the Enter button.
If so, we autocomplete.
local Text = TEXTBOX_HERE; local newText; Text.Changed:Connect(function(t) if (newText) then newText:Destroy() end; --Delete any old text --Copy the text properties newText = Instance.new('TextLabel', script.Parent.Parent); newText.Name = 'NewText' newText.Font = Text.Font; newText.Text = ''; newText.Size = Text.Size; newText.Position = Text.Position; newText.Visible = Text.Visible; newText.TextXAlignment = Text.TextXAlignment; newText.BackgroundTransparency = 1; newText.TextYAlignment = Text.TextYAlignment; newText.ZIndex = -50; newText.TextScaled = Text.TextScaled; newText.TextSize = Text.TextSize; local C = Text.TextColor3; newText.TextColor3 = Color3.fromRGB(C.r-50, C.g - 50, C.b - 50); --Check for i, v in pairs(game:GetService('Players'):GetPlayers()) do if (v.Name:lower():match(Text.Text:lower()) and Text.Text ~= '' ) then --if the name has a match for the textbox's text newText.Text = v.Name; newText.Parent = Text.Parent; end end end);
This will work if you type in bob, hiim, hi, ob, and etc. This works great if you remember a part of someone's name, but not the entire thing. Capitalization does not matter.
gave u the answer in disc so can u accept this
Closed as Non-Descriptive by Fifkee, Gameplayer365247v2, Prestory, and alphawolvess
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?