Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I put a player's picture and name into a gui?

The player with the most KO's at the end of the round needs to be displayed on a gui as "the MVP." The gui is done, but the scripting is more challenging than I thought and I have yet to find any helpful answers or links.

1 answer

✓ Accepted answer
topko = 0
plrname = nil
for i,v in pairs(game.Players:GetChildren()) do 
if v:FindFirstChild("leaderstats"):FindFirstChild("KOs").Value >= topko then
topko = v:FindFirstChild("leaderstats"):FindFirstChild("KOs").Value
plrname = v.Name
end
end

Winner = plrname
TextLabel.Text = "MVP "..Winner
ImageLabel.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..Winner

If this helped please press the up button and press answered this question next to my name!

11 comments

0

thanks! Question: How would the game know who the "winner" is?

2

I'll add that one second, also please up me!

0

Thanks! How will this look, and is there a way to change the look?

2

You can't change the look, except changing the x=200 and y=200 to different values. It will show their profile picture.

0

okay, thanks

0

Sorry, one more thing, can i use this script in an already existing gui?

0

Sure just edit the items to your extent.

0

IM SO SORRY xD, but where the heck do i put the script? the gui and buttons and everything is made but.... sigh... i have no idea. I'm new to Gui's

0

I'm going to guess if FilteringEnabled was turned off you could use a LocalScript under the "ScreenGui".

0

Thanks, it's working except the text is not. the image is displaying but not the text.

0

StarAd and I are working together on a project involving this, and I have a concern with the script. The MVP of the round various between people. Any fix?

This discussion is preserved as it was. New answers, comments, and votes are closed.