So I am making a rising lava game that uses tables for players
here is the code:
while true do
local t = 20
local msg = Instance.new("Hint", workspace)
local plrtable = require(game.ReplicatedStorage.PlrModule)
repeat
msg.Text = t
t = t - 1
wait(1)
until t == 0
t = 15
msg.Text = "Choosing map..."
wait(5)
local maps = game.ReplicatedStorage.Maps:GetChildren()
local randommap = maps[math.random(1, #maps)]
local clone = randommap:Clone()
clone.Parent = workspace
repeat
t = t - 1
msg.Text = "We are gonna to play "..clone.Name.." Mode:"..game.ReplicatedStorage.Mode.Value.." in "..t
wait(1)
until t == 0
for i, v in pairs(game.Players:GetChildren()) do
table.insert(plrtable, v)
print(plrtable)
v.Character.HumanoidRootPart.CFrame = CFrame.new(clone.Spawn.Position)
v.Character.HumanoidRootPart.CFrame = clone.Spawn.CFrame * CFrame.new(0, 1, 0)
end
msg.Text = "The lava will rise"
wait(10)
msg.Text = "The lava is rising"
--clone.EventScript.Disabled = false
t = 10
repeat
t = t - 1
msg.Text = "Time left: "..t
wait(1)
until t == 0
for i, v in ipairs(plrtable) do
print(plrtable[i])
--msg.Text =
print(table.concat(plrtable))--.." Has survived this round"
end
--msg.Text = plrtable.." Has survived this round"
clone.Lava:Destroy()
wait(5)
clone:Destroy()
wait()
end