I would like to know how to make this surface GUI image label change to the avatar of the name that is put into the textbox on a screengui by a player in-game. I am leaving out all the variables to make it easier to read.
Script:
game.Players.PlayerAdded:Connect(function(main) box1avatar.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username=" .. game.StarterGui.announcementholder.Frame.name end)
You can use
GetUserIdFromNameAsync
Example:
local player = (textbox.Text) local userId = Players:GetUserIdFromNameAsync(player) print(userId)