Hello!
I have a custom PlayerList. It adds players as they enter, removes them as they leave. It displays the player's avatar image, their name, their kills, and their kill streak. Unfortunately, it shows your kills/killstreaks for everyone, instead of displaying their unique kills/killstreaks.
How do I correct this to show each player's unique stats? The Name/Avatar Image shows the correct thing for each unique player, its just the stats from the Leaderstats that only show your info instead of each player's. I'm betting I've overlooked something simple here. ><
Not receiving any errors. Do I need to use WaitForChild() somewhere? If so, where?
Screen Gui - LocalScript:
game.StarterGui:SetCoreGuiEnabled("PlayerList", false)
local plr = game.Players.LocalPlayer
local kills = plr.leaderstats.Kills.Value
local killstreak = plr.leaderstats.Killstreak.Value
local Avatarurl = "http://www.roblox.com/Thumbs/Avatar.ashx?x=500&y=500&Format=Png&username="
while wait(1) do
for _,plr in pairs (game.Players:GetChildren()) do
if script.Parent.Holder:FindFirstChild(plr.Name) then
else
I = Instance.new("Frame")
I.Name = plr.Name
I.Parent = script.Parent.Holder
I.Style = "DropShadow"
-- NAME
T = Instance.new("TextLabel")
T.BackgroundTransparency = 1
T.Text = plr.Name
T.Parent = I
T.Size = UDim2.new(0, 165, 0, 35)
T.Position = UDim2.new(0, 10, 0, 0)
if plr.Name == game.Players.LocalPlayer.Name then
T.TextColor3 = Color3.fromRGB(0, 200, 255)
else
T.TextColor3 = Color3.new(1, 1, 1)
end
T.TextStrokeColor3 = Color3.new(0, 0, 0)
T.TextStrokeTransparency = 0.5
T.TextXAlignment = "Left"
T.Font = "SourceSansBold"
T.TextSize = 20
-- KILLS
K = Instance.new("TextLabel")
K.BackgroundTransparency = 1
K.Text = kills
K.Parent = I
K.Size = UDim2.new(0, 165, 0, 35)
K.Position = UDim2.new(0, 12, 0, 0)
K.TextColor3 = Color3.new(1, 1, 1)
K.TextStrokeColor3 = Color3.new(0, 0, 0)
K.TextStrokeTransparency = 0.5
K.TextXAlignment = "Right"
K.Font = "SourceSansBold"
K.TextSize = 20
-- KILL STREAK
KS = Instance.new("TextLabel")
KS.BackgroundTransparency = 1
KS.Text = killstreak
KS.Parent = T
KS.Size = UDim2.new(0, 165, 0, 35)
KS.Position = UDim2.new(0, 21, 0, 0)
KS.TextColor3 = Color3.new(255,0,0)
KS.TextStrokeColor3 = Color3.new(0, 0, 0)
KS.TextStrokeTransparency = 0.5
KS.TextXAlignment = "Right"
KS.Font = "SourceSansBold"
KS.TextSize = 20
-- AVATAR IMAGE
P = Instance.new("ImageLabel")
P.BackgroundTransparency = 1
P.Image = Avatarurl..plr.Name
P.Parent = T
P.Size = UDim2.new(1.25,0,1.25,0)
P.Position = UDim2.new(-1, 0, 0, 0)
end
end
end
And then the Screen Gui - Script:
function playerleft(player)
if script.Parent.Holder:FindFirstChild(player.Name) then
script.Parent.Holder:FindFirstChild(player.Name):remove()
end
end
game.Players.ChildRemoved:connect(playerleft)
Screenshots: This one shows how the custom player list appears in the game where the Avatar/Name is unique, but the Kills/Streak is cloned: https://ibb.co/h2QrtS
This one shows how the ScreenGui appears in PlayerGui during game play: https://ibb.co/b7dcYS

2 comments
Not sure how you'd change it to use the other players ones, but from what I can see it looks like you're using the localplayer's stats for every kill/streak.
:/ you're right. I'm just unsure how to get the other player's stats too.