I’m having issues with TeamImage not changing to visible, despite my efforts in changing the script. Below you may find the associated code
Serverscript
local Settings = script.Parent.Settings
local Path = nil
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local managementEvent = replicatedStorage.ManagementTeam
--Handle Admins. If You Have no admins, ignore this.
local Admins = {
"Infinite_Visions",
"Example_Name_Here"
}
--Get Creator Id
local ownerId = nil
if game.CreatorType == Enum.CreatorType.Group then
local PlaceInfo = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId)
ownerId = game:GetService("GroupService"):GetGroupInfoAsync(PlaceInfo.Creator.CreatorTargetId).Owner.Id
else
ownerId = game.CreatorId
end
--Setup Players Already In-Game
for i, player in pairs(game.Players:GetChildren()) do
--Add a slot to the leaderboard
local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
NewSlot.Name = player.Name
--Handle Names
local NameText = nil
if Settings.DisplayNames.Value == true then
NameText = player.DisplayName
else
NameText = player.Name
end
if Settings.UpperCase.Value == true then
NewSlot.PlrName.Text = string.upper(NameText)
else
NewSlot.PlrName.Text = NameText
end
--Handle Icons
if player.UserId == ownerId and Settings.ShowOwner.Value == true then
NewSlot.Owner.Visible = true
else
if Settings.ShowAdmin.Value == true then
for i = 1, #Admins do
if player.Name == Admins[i] then
NewSlot.Admin.Visible = true
end
end
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then
NewSlot.GamepassSymbol.Visible = true
elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
NewSlot.Premium.Visible = true
end
end
--If CustomData, Handle DataChanges
if Settings.CustomData.Value == true then
Path = script.Parent.Settings.CustomData
Path.Changed:Connect(function()
NewSlot.Currency1.Text = Path.Value
end)
end
NewSlot.Visible = true
--The Path to the Values you want displayed, if any.
NewSlot.Parent = script.Parent.LeaderboardFrame.HoldingFrame
end
game.Players.PlayerAdded:Connect(function(player)
--Add a slot to the leaderboard
local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
NewSlot.Name = player.Name
--Handle Names
local NameText = nil
if Settings.DisplayNames.Value == true then
NameText = player.DisplayName
else
NameText = player.Name
end
if Settings.UpperCase.Value == true then
NewSlot.PlrName.Text = string.upper(NameText)
else
NewSlot.PlrName.Text = NameText
end
--Handle Icons
if player.UserId == ownerId and Settings.ShowOwner.Value == true then
NewSlot.Owner.Visible = true
else
if Settings.ShowAdmin.Value == true then
for i = 1, #Admins do
if player.Name == Admins[i] then
NewSlot.Admin.Visible = true
end
end
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,13376596) and Settings.CustomGamepass.Value == true then
NewSlot.GamepassSymbol.Visible = true
elseif player.MembershipType == Enum.MembershipType.Premium and Settings.ShowPremium.Value == true then
NewSlot.Premium.Visible = true
end
end
--If CustomData, Handle DataChanges
if Settings.CustomData.Value == true then
Path = script.Parent.Settings.CustomData
Path.Changed:Connect(function()
NewSlot.Currency1.Text = Path.Value
end)
end
NewSlot.Visible = true
local function test(arg1, arg2)
print("testing", arg1, arg2)
end
end)
managementEvent.OnServerEvent:Connect(function(player, teststring, teamCheck)
if teamCheck == Teams.Management then
print(teamCheck)
local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
NewSlot:WaitForChild("TeamImage").Visible = true
NewSlot.Name = player.Name
end
end)
Localscript
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local plr = game.Players.LocalPlayer
local Teams = game:GetService("Teams")
local replicatedStorage = game:GetService("ReplicatedStorage")
local ManagementEvent = replicatedStorage.ManagementTeam
local teamCheck = plr.Team
plr:GetPropertyChangedSignal("Team"):Connect(function()
if plr.Team == Teams.Management then
teamCheck = Teams.Management
ManagementEvent:FireServer("test", teamCheck)
end