I’m trying to make a message that appears on every player’s screen when the game is over, but so far from my tests, it only shows up on 1 persons screen
local canCollect = true
local winnerAnnouncement = game.StarterGui.ScreenGui.WinnerAnnoucement
while canCollect == true do
wait(0.5)
if #list <= 1 then
canCollect = false
print("The winner is...", list)
print(list)
local player = game:GetService("Players"):GetPlayerFromCharacter(counted_clone.Parent)
player:WaitForChild("leaderstats").Points.Value = player:WaitForChild("leaderstats").Points.Value + 50
local name = player.Name
winnerAnnouncement.Text = "The winner is "..name
winnerAnnouncement.Active = true
end
end
end
end)
1 Like
There isn’t exactly the fully code, but this right here is only being replicated across the server-side
You’ll have to probably get all the Player’s GUI instead using a loop using game.Players:GetPlayers()
local canCollect = true
local winnerAnnouncement = game.StarterGui.ScreenGui.WinnerAnnoucement
while canCollect == true do
wait(0.5)
if #list <= 1 then
canCollect = false
print("The winner is...", list)
print(list)
local player = game:GetService("Players"):GetPlayerFromCharacter(counted_clone.Parent)
player:WaitForChild("leaderstats").Points.Value = player:WaitForChild("leaderstats").Points.Value + 50
local name = player.Name
for _, plr in pairs(game.Players:GetPlayers()) do
local PlayerGui = plr.PlayerGui
PlayerGui.ScreenGui.WinnerAnnouncement.Text = "The winner is "..player.Name
PlayerGui.ScreenGui.WinnerAnnouncement.Active = true
end
end
end
end
end)
2 Likes
Works perfectly I appreciate it