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

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

Asked by
StarAd 50
9 years ago

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

Log in to vote
3
Answered by 9 years ago
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!

0
thanks! Question: How would the game know who the "winner" is? StarAd 50 — 9y
2
I'll add that one second, also please up me! EmergencyAlt2 50 — 9y
0
Thanks! How will this look, and is there a way to change the look? StarAd 50 — 9y
2
You can't change the look, except changing the x=200 and y=200 to different values. It will show their profile picture. EmergencyAlt2 50 — 9y
View all comments (7 more)
0
okay, thanks StarAd 50 — 9y
0
Sorry, one more thing, can i use this script in an already existing gui? StarAd 50 — 9y
0
Sure just edit the items to your extent. EmergencyAlt2 50 — 9y
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 StarAd 50 — 9y
0
I'm going to guess if FilteringEnabled was turned off you could use a LocalScript under the "ScreenGui". EmergencyAlt2 50 — 9y
0
Thanks, it's working except the text is not. the image is displaying but not the text. StarAd 50 — 9y
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? DrCylonide 158 — 9y
Ad

Answer this question