There is no way to do this I don’t think, the only way is to loop through the table and change the UI. I don’t think this would make it that slow though so I would not really worry.
You could do that pretty easily. I assume the request is coming from the server, so you’d just have the table of winners and use a loop to fire a RemoteEvent to the client, which simply displays the well done screen.
It would look something like this:
local Players = game:GetService("Players")
local winnerTable = {} -- Table of IDs
for _, v in pairs(winnerTable) do
local player = Players:GetPlayerByUserID(v)
local playerRemote = -- Where ever the remote is within the player
playerRemote:FireClient()
end
local table_of_players = {
"coolguyweir";
"AnimationKrazy"
}
for i = 1,#table_of_players do
local Player = table_of_players[i]
remoteevent:FireClient(Player)
end
or
for i,v in pairs(table_of_players) do
remoteevent:FireClient(v)
end
You can see the player(s) who won and create a value with their name(s), use FireAllClients and if that client(s) found his / their name under the folder with the values than enable the gui else disabled it
This would son like a cheap way to do that but maybe you could make it so when the round ends the winner is still on the platform, and you could move the Position of a part when the round ends, by touching this part it would make the gui saying “Well done” appear and disappear after a couple of seconds
local event = somthnegng -- event here, event should be in replicated storage
local PlrsThatWon = {"Bob"}
local players = game:GetService("Players")
for i,plr in pairs(PlrsThatWon) do
event:FireClient(players[plr])
end
Client:
local event = somengrGARG -- event used in server script
local winUI = something -- winner UI frame
event.OnClientEvent:Connect(function()
winUI.Visible = true
task.wait(5)
winUI.Visible = false -- just make it disappear after 5s
end)
local winners = {elomala, coolguyweir, SummerLife, funniman232, Trollguy21412} --whatever the winners are
for i, v in pairs(winners) do
local player = game:GetService("Players"):FindFirstChild(v)
local GUI = player.PlayerGui.ScreenGui:FindFirstChild("WellDone") --whatever the GUI name is
GUI.Visible = true
end
Faster method would be to send the table of select users to each client via fire all clients then just do a simple if table.find(selectUsers, localplayer.UserId).
Ok, the round is over you either send some event or a function when that happens and when “firing” it you send the parameter where it states who the winner is and then when on the script of the function you make a gui visible on that players playergui or just clone them a gui from somewhere.
Of course if there is many you could send the table containing all the winners too