I have a textbox and whenever you enter in a Roblox username is fetches the username (so like if u type ‘thINKINGAiinight’ it will autocorrect to ‘ThinkingAIINight’), and the users Headshot image, but I was wondering how I could also get the rank of the user if their in my group or not.
Here’s a snip of my code.
local function OnFocusLost(EnterKeyPressed, InputThatCausedFocusLost)
if EnterKeyPressed then
local TextBoxText = TextBox.Text
local EnteredNamesUserID = GetUserIDFromName(TextBoxText)
local EnteredName = Players:GetNameFromUserIdAsync(EnteredNamesUserID)
--local PlayerIsInGroup = EnteredNamesUserID:IsInGroup(GameDataModule.GroupID)
TextBox.Text = ""
Image.Image = "https://www.roblox.com/headshot-thumbnail/image?userId="..EnteredNamesUserID.."&width=420&height=420&format=png"
PlayerName.Text = "Activity log for "..EnteredName
--if PlayerIsInGroup then
--PlayerRank.Text = EnteredNamesUserID:GetRoleInGroup(GameDataModule.GroupID)
--else
--PlayerRank.Text = "Customer"
--end
EditClose()
end
end
TextBox.FocusLost:Connect(OnFocusLost)