Hi
How can I show a status message to only the players who die and are sent to the lobby. In my case I set the status to "Waiting for enough players" while the players are in the lobby. But this status message will also pop up for the players still in the game. Anyone know how I can just show a status message to players in the lobby?
In my main script I have this (part of code):
-- Game loop
for i = GameLength,0,-1 do
for j, player in pairs(plrs) do
if player then
character = player.Character
if not character then
--Left the game
else
if character:FindFirstChild("GameTag") then
--They are still alive
else
--They are dead
table.remove(plrs,j)
Status.Value = "Waiting for enough players"
--print(player.Name.." has been removed from the game")
end
end
else
table.remove(plrs,j)
Status.Value = "Waiting for enough players"
--print(player.Name.." has been removed from the game")
end
end
end
I also have a status localscript that shows the current status (as an image):
local Status = game:GetService("ReplicatedStorage"):WaitForChild("Status")
if Status.Value == "Waiting for enough players" then
print("StatusPage: Waiting for enough players")
StatusImage.Visible = true
end
But this code will show 'Waiting for enough players' also for the players still in the game. How to just show for the players in the lobby?

1 comment
RemoteEvents