Hello there!
So I’m making a system round for a TDM game meant to mock the “OLD ROBLOX WAS BETTER”/“BRING OLD ROBLOX” term, anyway, the system causes the players to reset after the intermission is done and the game will take 2 seconds (The amount of time for the players to reset) and spawn them in their respective teams for 280 seconds and repeat, but my way of doing so feels wrong. Any suggestions?
--//Round Timer\\--
local IntermissionTime = 12
local RoundTime = 12
--//Services\\--
local Rep = game:GetService("ReplicatedStorage")
local Plrs = game:GetService("Players")
local Tf2 = game:GetService("Teams")
--//MusicIDS\\--
local TableofMusicIDS = {
Lobby = ""
}
--//Connections\\--
local UpdateTimer = Rep:WaitForChild("UpdateTimer")
--Player
local Player = Plrs.PlayerAdded:Wait()
local Character = Player.Character or Player.CharacterAdded:Wait()
local NETRUALSPAWN = workspace:WaitForChild("SpawnLocation")
while true do
for i = IntermissionTime, 1, -1 do
UpdateTimer:FireAllClients(i)
task.wait(1)
end
NETRUALSPAWN.Neutral = false
local RandomTeamChance = math.random(1,2)
if RandomTeamChance == 1 then
Player.Team = Tf2.Robloxians
local Weapon = Rep:WaitForChild("ClassicSword"):Clone()
Weapon.Parent = Player.Backpack
Character:UnequipTools()
elseif RandomTeamChance == 2 then
Player.Team = Tf2.Administrators
end
Character:WaitForChild("Humanoid").Health = 0
task.wait(2)
for i = RoundTime, 1, -1 do
UpdateTimer:FireAllClients(i)
task.wait(1)
end
task.wait(5)
Character:WaitForChild("Humanoid").Health = 0
task.wait(2)
NETRUALSPAWN.Neutral = true
Player.Team = Tf2.Lobby
end