I have a group of textboxes that I was trying to code to be more effecient by placing all 6 of their focuslost functions into a for loop to save space. But for some odd reason it doesn’t register the textbox.FocusLost event when it’s used within a for loop. Do I need to just write out all 6 individually or am I doing something wrong.
local mytextbox = CustonNames.S
mytextbox.FocusLost:Connect(function()
print(“FunctionWorked”)
-----This Works
end)
for i, Textbox in pairs(CustonNames:GetChildren()) do
Textbox.FocusedLost:Connect(function()
TierNameChanged:FireServer(Textbox.Name, Textbox.Text)
end)
end
The Error I get for the for loop:
FocusedLost is not a valid member of TextBox “Players.CalebHbk10.PlayerGui.Screen.CustomNames.S” - Client - CustomTierNames:58