I want to add a teamdeathmatch but i'm new to scripting so could someone copy this script and make it into a team deathmatch? Thanks!

--Script

ServerStorage = game:GetService("ServerStorage")
ReplicatedStorage = game:GetService("ReplicatedStorage")
Players = game:GetService("Players")

Maps = ServerStorage:WaitForChild('Maps'):GetChildren()
Status = ReplicatedStorage:WaitForChild('Status')

while true do
	
	--Intermission
	
	local Countdown = 30 -- ten second intermission, make this as long as you want
	
	repeat wait(1)
		Countdown = Countdown - 1
		
		Status.Value = 'Intermission : '..Countdown
	until Countdown <= 0
	
	--Choose the map.
	
	Status.Value = 'Choosing Map.'
	
	local ChosenMap = Maps[math.random(1, #Maps)]:Clone()
	local Spawns = ChosenMap:FindFirstChild('Spawns'):GetChildren()
	local RandomSpawn = Spawns[math.random(1, #Spawns)]
	
	wait(4) -- little pause, make this as long as you want
	
	ChosenMap.Parent = workspace
	
	Status.Value = "Map chosen Round starting! "
	
	wait(4) -- little pause, make this as long as you want
	
	--teleport the players
	
	for _, Player in pairs(Players:GetChildren())do
		if Player.Character and Player.Character:FindFirstChild('Humanoid') then
			Player.Character.HumanoidRootPart.CFrame = RandomSpawn.CFrame
		end
	end
	
	Countdown = 3 -- Starting Round In, make this as long as you want
	
	repeat wait(1)
		Countdown = Countdown - 1
		
		Status.Value = 'Starting Round in : '..Countdown
	until Countdown <= 0
	
	Countdown = 240 -- Game Time, ten seconds so the video isn't long, make this as long as you want.
	
	repeat wait(1)
		Countdown = Countdown - 1
		
		Status.Value = 'Round : '..Countdown
	until Countdown <= 0
	
	--Kill the players
	
	for _, Player in pairs(Players:GetChildren())do
		if Player.Character and Player.Character:FindFirstChild('Humanoid') then
			Player.Character.Humanoid:TakeDamage(2000)
		end
	end
	
	ChosenMap:Destroy()
	
	Status.Value = 'Round Ended, waiting for new game.'
	
	wait(4) -- little pause, make this as long as you want.

end

2 comments

0

This isn't a request site. Things you can do to start learning how to script is to look at the roblox dev forum, tutorials, and more.

0

DO NOT start on the dev forum, start on developer.roblox.com