I have been having a constant issue while trying to make a GUI. It worked for a little bit, but when testing with a friend it only showed the display of my data ( name, group, group rank ) and not his. I don’t see the issue with the script, and a different script uses SetCoreGuiEnabled to disable default leaderboard so don’t worry about that.
I’ve tried numerous methods, and none of them are working. Pretty stressful, not gonna lie.
local ItemTemplate = game:GetService("ReplicatedStorage").Player1
local GroupIDs = {
["Rome"] = 4165387,
["Urbanae"] = 6892611,
["XII"] = 6892171,
["Praetorian"] = 6892505
}
local ImageIDs = {
["Rome"] = "rbxassetid://6924766053",
["Urbanae"] = "rbxassetid://2",
["XII"] = "rbxassetid://1",
["Praetorian"] = "rbxassetid://3",
}
game.Players.PlayerAdded:Connect(function(Player)
local NewItem = ItemTemplate:Clone()
local Group = NewItem:WaitForChild("Group")
local Rank = NewItem:WaitForChild("Rank")
local Username = NewItem:WaitForChild("User")
NewItem.Parent = script.Parent.Leader.PlayerList
NewItem.Name = Player.Name
Username.TextScaled = true
Username.Text = Player.Name
for GroupName, GroupID in pairs (GroupIDs) do
if Player:IsInGroup(GroupID) then
Group.Image = ImageIDs[GroupName]
Rank.Text = Player:GetRoleInGroup(GroupID)
end
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
local Frame = script.Parent.Leader.PlayerList[Player.Name]
if Frame then
Frame:Destroy()
end
end)
This is a local script, btw