So, I am helping somebody with a script they can’t find out, and I can’t find it out either. (because i cant script) I don’t know what they are making but here is the script.
local status = game.ReplicatedStorage.Status
local maps = game.ReplicatedStorage.Maps:GetChildren()
while true do
for i = 1,21 do
status.Value = "Intermission "..21-i
wait(1)
end
local rand = math.random(1, #maps)
local map = maps[rand]:Clone()
map.Parent = workspace
status.Value = "The map is... "..map.Name
wait(5)
local players = game.Players:GetChildren()
for i = 1,#players do
if players[i].Character ~= nil then
local spawnLocation = math.random(1,#workspace.Teleports:GetChildren())
players[i].Character:MoveTo(workspace.Teleports:GetChildren()[spawnLocation].Position)
players[i].Character.Parent = workspace.Ingame
end
end
local roundLength = 30
local canWin = true
local roundType = ""
if map:FindFirstChild("Lava Jumps") then
roundType = "Lava Jumps"
map.EndPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
status.Value = hit.Parent.Name.." has won the round!"
canWin = false
game.Players[hit.Parent.Name].leaderstats.Money.Value = game.Players[hit.Parent.Name].leaderstats.Money.Value +5
game.Players[hit.Parent.Name].leaderstats.Wins.Value = game.Players[hit.Parent.Name].leaderstats.Wins.Value +1
canWin:Destroy()
end
end)
elseif map:FindFirstChild("Maze") then
roundType = "Maze"
end
repeat
roundLength = roundLength -1
status.Value = "Time Left: "..roundLength
wait(1)
until roundLength == 0 or canWin == false or #workspace.Ingame:GetChildren() == 0 or (#workspace.Ingame:GetChildren() == 1 and roundType == "Maze")
if #workspace.Ingame:GetChildren() == 1 and roundType == "Maze" then
map.EndPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
status.Value = hit.Parent.Name.." has won the round!"
game.Players[hit.Parent.Name].leaderstats.Money.Value = game.Players[hit.Parent.Name].leaderstats.Money.Value +5
game.Players[hit.Parent.Name].leaderstats.Wins.Value = game.Players[hit.Parent.Name].leaderstats.Wins.Value +1
end
wait(0.01)
map:Destroy()
local players = game.Players:GetChildren()
for i = 1,#players do
if players[i].Character ~= nil then
players[i]:LoadCharacter()
end
end
end)