Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I fix this script which announces list of survivors?

Asked by 10 years ago
    players = game.Players:GetPlayers()
    for _,v in pairs(players) do
    if(v.Character) then
        v.Character:MoveTo(Vector3.new(243,1.5,-225.4))
        wait(15)
        survivors = v.Name
        survivors = survivors..", "..v.Name
        Finished = Instance.new("Message")
        Finished.Parent = game.Workspace
        Finished.Text = "The following have survived:" (survivors)

It doesn't work. It is supposed to list the survivor names.

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago
Survivors = {}

players = game.Players:GetPlayers()
for _,v in pairs(players) do
if(v.Character) then
    v.Character:MoveTo(Vector3.new(243,1.5,-225.4))
    wait(15)
   table.insert(Survivors,v.Name)
    Finished = Instance.new("Message")
    Finished.Parent = game.Workspace
    Finished.Text = "The following have survived"..table.concat(Survivors,',')

TADA

+1 if this helped!

0
Earlier I was panicking so much that I couldn't think. I will try this one and if it works, I +1! Overpride 0 — 10y
Ad

Answer this question