Hey, I’m having a bit of an issue trying to set this text label’s Text property and I’m not sure where I’m going wrong.
Here is my code:
CreateOrderFrame.SelectButton.Activated:Connect(function()
local TextToSet = GetPlayerFromPartialName(TextBox.Text)
print(TextToSet)
PlayerNameLabel.Text = TextToSet.Name
end)
The function GetPlayerFromPartialName looks like this:
local function GetPlayerFromPartialName(String)
for _, Player in ipairs(Players:GetPlayers()) do
if Player.Name:lower():find("^"..String:lower()) then
return Player
end
end
end
As said in the title, it will print the text perfectly fine but it doesn’t set to the text box and there are also no errors or anything in the output. Really stumped on this one!