Can I have two parts of my script at the same time

I basically want whats circled to run at the same time instead of waiting 45 seconds before running the repeat without doing separate scripts. is it even possible?
image

local currentround = true
local aliveprey = true
local Lobby = game.Workspace.LobbySpawn

local function current()
	wait(45)
	currentround = false
end
	

current()

repeat
	wait(1)
	local players = game.Teams.Prey:GetPlayers()
	
	if #players <= 0 then
		aliveprey = false
	end

	wait(1)
	if currentround == false then
		for i,v in ipairs(game.Players:GetChildren())  do
			print(v.Name)
			repeat
				wait(1)
			until v and v.character
			v.character:WaitForChild("HumanoidRootPart").Position = Lobby.Position
			v.Team = game.Teams.Lobby
			v.PlayerGui.Top.TextLabel.Text = "Predator Has Failed"
		end
		script.Disabled = true
	end
	wait(1)
	if aliveprey == false then
		for i,v in ipairs(game.Players:GetChildren())  do
			print(v.Name)
			repeat
				wait(1)
			until v and v.character
			v.character:WaitForChild("HumanoidRootPart").Position = Lobby.Position
			v.Team = game.Teams.Lobby
			v.PlayerGui.Top.TextLabel.Text = "Predator Has Caught their prey"
		end
		script.Disabled = true
	end
until aliveprey == false
1 Like

use task.spawn()

local function current()
	wait(45)
	currentround = false
end
	

task.spawn(current)
3 Likes

You can do that with task.spawn.

@Kaid3n22 got it before me haha-

3 Likes