Hello! I was going through my old games and I played one of them, only to get this error:
Here is my code:
wait(4)
function gameStart()
game.ReplicatedStorage.GameStart:FireAllClients()
local map = game.ReplicatedStorage.Maps.Map1:Clone()
map.Parent = game.Workspace
map.Name = "Map"
game.Workspace.Text.Value = "Game Starting In 5 Seconds!"
wait(1)
game.Workspace.Text.Value = "Game Starting In 4 Seconds!"
wait(1)
game.Workspace.Text.Value = "Game Starting In 3 Seconds!"
wait(1)
game.Workspace.Text.Value = "Game Starting In 2 Seconds!"
wait(1)
game.Workspace.Text.Value = "Game Starting In 1 Seconds!"
wait(1)
game.Workspace.Text.Value = "The Game Has Started! GO!"
game.Workspace.GameMusic:Play()
game.Workspace.Lobby.LobbyMusic:Stop()
game.Workspace.Barrier.CanCollide = false
game.Workspace.Barrier.Transparency = 1
end
game.Workspace.Winner.Touched:Connect(function(otherPart)
if otherPart.Parent:FindFirstChild("Humanoid") ~= nil then
game.Workspace.Lobby.LobbyMusic:Play()
game.Workspace.GameMusic:Stop()
otherPart.Parent:MoveTo(game.Workspace.SpawnPoint.Position)
game.ReplicatedStorage.GameEnd:FireAllClients()
game.Workspace.Barrier.CanCollide = true
game.Workspace.Text.Value = otherPart.Parent.Name .. "Has Won! Congrats!"
wait(1)
game.Workspace:FindFirstChild("Map1"):Destroy()
game.Workspace.Text.Value = "Intermission"
game.Workspace.Barrier.Transparency = 0.6
wait(15)
gameStart()
end
end)
game.Workspace.Lobby.LobbyMusic:Play()
wait(5)
gameStart()
I know it could be cleaned up a bit, but I think it’s still pretty readable. If you think you know what wrong, please let me know. Thank you and have a wonderful day!