Hi. I am making a custom leaderboard for my game and I have ran into an issue, while making the frames background transparent, since it is a client script, it only makes the frame invisible for 1 player
I have tried firing a remove events and it still has not worked.
The script:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local plrgui = player.PlayerGui
local gui = plrgui:WaitForChild("PlayerList")
local corner = Instance.new("UICorner")
local c = gui:WaitForChild("PlayerListContainer")
local sf = c:WaitForChild("ScrollList")
local name = player.Name
sf:WaitForChild("" .. name):WaitForChild("Ping").Transparency = 1 -- line which doesn't work
sf:WaitForChild("" .. name):WaitForChild("BGFrame").Transparency = 1 -- line which doesn't work
sf:WaitForChild("StatNameFrame"):Destroy()
Like DeveloperBLK said, your best option would probably be to use a remote event and use a server script to loop through all of the players in the server.
If you have anymore questions regarding how to loop, you can find them here! DevHub | Roblox
Of course, I can help you too. But it might be easier just to search up "loops’, etc.
local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local event = RS:WaitForChild("Leaderboard")
event.OnServerEvent:Connect(function(plr)
local gui = plr.PlayerGui:WaitForChild("PlayerList")
local c = gui:WaitForChild("PlayerListContainer")
local sf = c:WaitForChild("ScrollList")
for i , player in pairs(Players:GetPlayers()) do
sf:WaitForChild(player.Name):WaitForChild("Ping").Transparency = 1
sf:WaitForChild(player.Name):WaitForChild("BGFrame").Transparency = 1
end
end)
for i , player in pairs(Players:GetPlayers()) do
sf:WaitForChild(player.Name):WaitForChild("Ping").Transparency = 1
sf:WaitForChild(player.Name):WaitForChild("BGFrame").Transparency = 1
end
Those changes will only occur for the client of which the local script is executing for, you’ll need to either handle this on the server for it to replicate to each client or alternatively you can handle the replication yourself by firing each client via calling :FireAllClients() on a RemoteEvent instance and performing the necessary code for each client.