i’m currently rewriting my round system right now but for some reason it doesn’t work, there are no errors or anything
heres the code
local Players = game:GetService("Players")
local GameFolder_Variables = game:GetService("ReplicatedStorage").game
local GameFolder = workspace.game
local Survivors = {}
local Killer = {}
local TweenService = game:GetService("TweenService")
REQUIREDPLAYERS = 1
CHECK_IF_KILLER_ALIVE = false
local SoundService = game:GetService("SoundService")
local Sounds_Group = SoundService.soundsgroup
local tInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local tInfo2 = TweenInfo.new(0.4, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local LOBBY_MUSIC_TWEEN_1 = TweenService:Create(Sounds_Group.lobby_theme, tInfo, {Volume = 1.3})
local LOBBY_MUSIC_TWEEN_0 = TweenService:Create(Sounds_Group.lobby_theme, tInfo, {Volume = 0})
Sounds_Group.lobby_theme:Play()
local BadgeService = game:GetService("BadgeService")
Players.PlayerAdded:Connect(function(plr)
if not plr:FindFirstChild("ValuesFolder") then
local folder = Instance.new("Folder",plr)
folder.Name = "ValuesFolder"
local DiedValue = Instance.new("BoolValue",folder)
DiedValue.Name = "DiedValue"
local InMenu = Instance.new("BoolValue",folder)
InMenu.Name = "InMenu"
local IsKiller = Instance.new("BoolValue",folder)
IsKiller.Name = "IsKiller"
local IsSurvivor = Instance.new("BoolValue",folder)
IsSurvivor.Name = "IsSurvivor"
elseif plr:FindFirstChild("ValuesFolder") then
return
end
end)
function System()
if Players.NumPlayers == REQUIREDPLAYERS then
--repeat task.wait() until Players == REQUIREDPLAYERS
task.wait(GameFolder_Variables.values.TimeBeforeRestarting.Value)
GameFolder_Variables.values.TimeBeforeRestarting.Value = 3
GameFolder_Variables.values.Time.Value = 120
for _, all_players in pairs(Players:GetPlayers()) do
if all_players then
if all_players:FindFirstChild("ValuesFolder") then
if all_players:FindFirstChild("ValuesFolder").IsKiller.Value == true or all_players:FindFirstChild("values_folder").IsSurvivor.Value == true then
all_players:FindFirstChild("ValuesFolder").IsSurvivor.Value = false
all_players:FindFirstChild("ValuesFolder").IsSurvivor.Value = false
end
end
end
end
repeat task.wait(1) GameFolder_Variables.values.Time.Value -= 1 until
GameFolder_Variables.values.Time.Value <= 0
LOBBY_MUSIC_TWEEN_0:Play()
if GameFolder_Variables.values.Time.Value == 0 then
task.wait(1)
print("Preparing")
Sounds_Group.tick:Stop()
Sounds_Group.clock_chime:Play()
end
local chosen = Players:GetChildren()[math.random(1, #Players:GetChildren())]
if chosen then
if chosen:FindFirstChild("ValuesFolder").IsKiller.Value == false and chosen:FindFirstChild("ValuesFolder").IsSurvivor.Value == false then
chosen:FindFirstChild("ValuesFolder").IsKiller.Value = true
chosen:FindFirstChild("ValuesFolder").IsSurvivor.Value = false
table.insert(Killer, chosen)
end
end
if not BadgeService:UserHasBadgeAsync(chosen.UserId,2144098131) then
BadgeService:AwardBadge(chosen.UserId,2144098131)
else
print(chosen.Name.." already has the badge.")
end
for _, survivor_players in pairs(Players:GetPlayers()) do
if survivor_players:FindFirstChild("ValuesFolder") then
if survivor_players:FindFirstChild("ValuesFolder").IsKiller.Value == false and survivor_players:FindFirstChild("ValuesFolder").IsSurvivor.Value == false then
survivor_players:FindFirstChild("ValuesFolder").IsKiller.Value = false
survivor_players:FindFirstChild("ValuesFolder").IsSurvivor.Value = true
table.insert(Survivors, survivor_players)
end
end
end
task.wait(12)
if chosen:FindFirstChild("ValuesFolder").IsKiller.Value == true then
if chosen.Character then
chosen.Character:FindFirstChild("HumanoidRootPart").CFrame = GameFolder.warm_killer_spawn.CFrame
end
end
end
end
while true do
task.wait()
System()
end