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

How do I make the text display the winners on line 40?

Asked by
Prioxis 673 Moderation Voter
10 years ago

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

2 answers

Log in to vote
0
Answered by
MrFlimsy 345 Moderation Voter
10 years ago

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
0
Haha thanks it worked and I see you added your name to the message on line 1 btw in the game I kept it there :P Prioxis 673 — 10y
Ad
Log in to vote
-2
Answered by 10 years ago

You could try to connect it using .. and a string

Answer this question