I'm making a game similar to plastic pirates using this game script I made but I need help on line 40 to display the winners and add points to their leaderstats
--1337ZombieGamer local Base = game.Workspace.BasePlate while wait() do local m = Instance.new("Message", Workspace) m.Text = "Match will start in 60 seconds" wait(5) m:remove() wait(30) local m = Instance.new("Message", Workspace) m.Text = "Match will start in 60 seconds" wait(5) m:remove() wait(20) local m = Instance.new("Message", Workspace) m.Text = "Match will start in 10 seconds" wait(5) m:remove() wait(10) local m = Instance.new("Message", Workspace) m.Text = "Match begin! 120 Seconds Remain!" Base.Transparency = 1 Base.CanCollide = false wait(5) m:remove() wait(120) local m = Instance.new("Message", Workspace) m.Text = "Match Ended!" wait(3) m.Text = "Winners :" -- need help here end
This may or may not work. I'm assuming you want players who die during the game to be removed from the "winners".
--1337ZombieGamer and MrFlimsy local Base = game.Workspace.BasePlate while wait() do local m = Instance.new("Message", Workspace) for i = 60, 1, -1 do m.Text = "Match will start in "..i.." seconds" wait(1) end m.Text = "Match begin! 120 Seconds Remain!" Base.Transparency = 1 Base.CanCollide = false wait(5) m:remove() local alive = {} local diedEvent for _,v in pairs(game.Players:GetChildren()) do table.insert(alive,v.Name) diedEvent = v.Died:connect(function() table.remove(alive,v.Name) end) end) wait(120) local m = Instance.new("Message", Workspace) m.Text = "Match Ended!" wait(3) m.Text = "Winners:" wait(1) for _,v in pairs(alive) do m.Text = v wait(1) end m:remove() diedEvent:disconnect() alive = {} end