Oh, yeah, my previous script that I had functioning when a button was clicked was this which defines it:
function getFullNameFromPartial(PartialName)
local foundPlayer = nil
local Players = game.Players:GetPlayers()
for i = 1, #Players do
local CurrentPlayer = Players[i]
if string.lower(CurrentPlayer.Name):sub(1, #PartialName) == string.lower(PartialName) then
foundPlayer = CurrentPlayer.Name
break
end
end
return foundPlayer
end
PlayerNameBox:GetPropertyChangedSignal("Text"):Connect(function()
local PartialName = PlayerNameBox.Text
local foundPlayer
local Players = game.Players:GetPlayers()
for i = 1, #Players do
local CurrentPlayer = Players[i]
if string.lower(CurrentPlayer.Name):sub(1, #PartialName) == string.lower(PartialName) then
foundPlayer = CurrentPlayer.Name
PlayerNameBox.PlaceholderText = CurrentPlayer.Name
break
end
end
-- use foundPlayer variable to do the other stuff
end)
I’m on mobile so I’m not sure if this will work or not. Edit: I dont think that PlayerNameBox.PlaceholderText = CurrentPlayer.Name would do anything since a text has already been typed also CurrentPlayer.Name can be shortened by using foundPlayer
So, I replace all of the PartialName s in this script to TextboxLocation.Text?
PlayerNameBox:GetPropertyChangedSignal("Text"):Connect(function()
local foundPlayer = nil
local Players = game.Players:GetPlayers()
for i = 1, #Players do
local CurrentPlayer = Players[i]
if string.lower(CurrentPlayer.Name):sub(1, #PartialName) == string.lower(PartialName) then
foundPlayer = CurrentPlayer.Name
PlayerNameBox.PlaceholderText = CurrentPlayer.Name
break
end
end
return foundPlayer
end)
It looks like the autofill shows up when you click off the TextBox I’m assuming? Are there any TextBox related events (Other than the GetPropertyChangedSignal) that could be intercepting that?
Hello!! So, I tried it, but it didn’t work. Here is my script. Mind checking it? @flkfv
local PlayerNameBox = game.StarterGui.OrderingStart.EnterUserFrame.EnterUserTextBox
PlayerNameBox:GetPropertyChangedSignal(“Text”):Connect(function()
local PartialName = PlayerNameBox.Text
local foundPlayer
local Players = game.Players:GetPlayers()
for i = 1, #Players do
local CurrentPlayer = Players[i]
if string.lower(CurrentPlayer.Name):sub(1, #PartialName) == string.lower(PartialName) then
foundPlayer = CurrentPlayer.Name
PlayerNameBox.PlaceholderText = CurrentPlayer.Name
break
end
end
end)
local PlayerNameBox = game.StarterGui.OrderingStart.EnterUserFrame.EnterUserTextBox
PlayerNameBox:GetPropertyChangedSignal(“Text”):Connect(function()
local PartialName = PlayerNameBox.Text
local foundPlayer
local Players = game.Players:GetPlayers()
for i = 1, #Players do
local CurrentPlayer = Players[i]
if string.lower(CurrentPlayer.Name):sub(1, #PartialName) == string.lower(PartialName) then
foundPlayer = CurrentPlayer.Name
PlayerNameBox.PlaceholderText = CurrentPlayer.Name
break
end
end
end)