Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this image change to the avatar of the name put into the textbox by the player?

Asked by 4 years ago

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)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You can use

GetUserIdFromNameAsync

Example:

local player = (textbox.Text)

local userId = Players:GetUserIdFromNameAsync(player)

print(userId)
0
Where? BabyHades_2 40 — 4y
0
I edited my post itz_rennox 412 — 4y
0
Thank you BabyHades_2 40 — 4y
0
No problem :D itz_rennox 412 — 4y
0
If you need help just answer itz_rennox 412 — 4y
Ad

Answer this question