- What do you want to achieve?
I want to make a fully working player round system. This is only one of the scripts.
- What is the issue? Include screenshots / videos if possible!
The issue is that I want the round system to only run once(the moment the player joins), and the intermission timer shouldn’t reset everytime the player dies.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried putting everything into function’s and running the function. I also have a intermission timer for my script but it resets every time the player dies. This script is located inside a text label. I’ve looked through a lot of articles in Developer forum. but they didn’t seem to help me. If there is a article to solve my problem, it would greatly be appreciated.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local function Hi()
for i = 80,0,-1 do
local Minute = math.floor(i/60)
local Seconds = math.floor(i%60)
if Seconds < 10 then
Seconds = "0"..math.floor(i%60)
end
script.Parent.Text = Minute..":"..Seconds
wait(1)
end
end
Hi()
local function RoundSystem()
local BluetTeam = {}
local RedTeam = {}
script.Parent = game.ServerScriptService
local function ShuffleAllPlauyers(AllPlayers)
local AllPlayersClone = {unpack(AllPlayers)}
for i = 1, #AllPlayers do
AllPlayers[i] = table.remove(AllPlayersClone, math.random(#AllPlayersClone))
end
return AllPlayers
end
local TableForAllPlayers = {}
for i,v in pairs(game.Players:GetPlayers()) do
table.insert(TableForAllPlayers, v.Name)
end
local ShuffledPlayers = ShuffleAllPlauyers(TableForAllPlayers)
for i =1, math.ceil(#ShuffledPlayers/2) do
table.insert(RedTeam, ShuffledPlayers[i])
table.remove(ShuffledPlayers, i)
end
for i,v in pairs(ShuffledPlayers) do
table.insert(BluetTeam, v)
end
local RedTeamSapwn = game.Workspace:WaitForChild("SpawnPointsRedTeam")
local BlueTeamSpawn = game.Workspace:WaitForChild("SpawnPointsBlueTeam")
for NumberValue,v in pairs(RedTeam) do
local Character = game.Workspace:WaitForChild(v)
--[[ if Character.LeftHand then
Character.HumanoidRootPart.Anchored = true
Character.Head.Anchored = true
Character.LeftHand.Anchored = true
Character.LeftFoot.Anchored = true
Character.LeftLowerArm.Anchored = true
Character.LeftLowerLeg.Anchored = true
Character.LeftUpperArm.Anchored = true
Character.LeftUpperLeg.Anchored = true
Character.LowerTorso.Anchored = true
Character.RightFoot.Anchored = true
Character.RightHand.Anchored = true
Character.RightLowerArm.Anchored = true
Character.RightLowerLeg.Anchored = true
Character.RightUpperArm.Anchored = true
Character.UpperTorso.Anchored = true
Character.Head.Anchored = true
else
Character.Head.Anchored = true
Character.HumanoidRootPart.Anchored = true
Character["Left Arm"].Anchored = true
Character["Right Arm"].Anchored = true
Character.Torso.Anchored = true
Character.LeftLeg.Anchored = true
Character.RightLeg.Anchored = true
end]]
if #RedTeam == 1 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part1").Position + Vector3.new(0,5,0)
end
if #RedTeam == 2 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part"..NumberValue).Position + Vector3.new(0,5,0)
end
if #RedTeam == 3 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
if #RedTeam == 4 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
if #RedTeam == 5 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
end
for NumberValue,v in pairs(BluetTeam) do
local Character = game.Workspace:WaitForChild(v)
--[[ if Character.LeftHand then
Character.HumanoidRootPart.Anchored = true
Character.Head.Anchored = true
Character.LeftHand.Anchored = true
Character.LeftFoot.Anchored = true
Character.LeftLowerArm.Anchored = true
Character.LeftLowerLeg.Anchored = true
Character.LeftUpperArm.Anchored = true
Character.LeftUpperLeg.Anchored = true
Character.LowerTorso.Anchored = true
Character.RightFoot.Anchored = true
Character.RightHand.Anchored = true
Character.RightLowerArm.Anchored = true
Character.RightLowerLeg.Anchored = true
Character.RightUpperArm.Anchored = true
Character.UpperTorso.Anchored = true
Character.Head.Anchored = true
else
Character.Head.Anchored = true
Character.HumanoidRootPart.Anchored = true
Character["Left Arm"].Anchored = true
Character["Right Arm"].Anchored = true
Character.Torso.Anchored = true
Character.LeftLeg.Anchored = true
Character.RightLeg.Anchored = true
end]]
if #BluetTeam == 1 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = BlueTeamSpawn:FindFirstChild("Part1").Position + Vector3.new(0,5,0)
end
if #BluetTeam == 2 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = BlueTeamSpawn:FindFirstChild("Part"..NumberValue).Position + Vector3.new(0,5,0)
end
if #BluetTeam == 3 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = BlueTeamSpawn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
if #BluetTeam == 4 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = BlueTeamSpawn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
if #BluetTeam == 5 then
game.Workspace:WaitForChild(v):WaitForChild("HumanoidRootPart").Position = RedTeamSapwn:FindFirstChild("Part"..NumberValue).Position+ Vector3.new(0,5,0)
end
end
local BarrierForPlayers = game.ReplicatedStorage:WaitForChild("Barrier")
local function Barriers()
for i,v in pairs(game.Workspace.SpawnPointsBlueTeam:GetChildren()) do
if v:IsA("Part") then
local CloneBarrier = BarrierForPlayers:Clone()
CloneBarrier.Parent = workspace
CloneBarrier.CFrame = v.CFrame * CFrame.new(Vector3.new(-CloneBarrier.Size.Y/2,0,0), Vector3.new(-17,180,0))
end
end
for i,v in pairs(game.Workspace.SpawnPointsRedTeam:GetChildren()) do
if v:IsA("Part") then
local CloneBarrier = BarrierForPlayers:Clone()
CloneBarrier.Parent = workspace
CloneBarrier.CFrame = v.CFrame * CFrame.new(Vector3.new(-CloneBarrier.Size.Y/2,0,0), Vector3.new(-17,180,0))
end
end
end
Barriers()
end
RoundSystem()
– The moment this intermisson timer hits zero, the round system will run, but if player dies it resets.

