I seem to be encountering an issue with certain listeners not activation when they logically should. I've tested the functions which they connect to and they seem to work, but whenever I to connect them to a listener, it doesn't seem to work.
Players1 = {} Sniper = "" local IntermissionGUI = game.ReplicatedStorage:WaitForChild("InfoValue") function RandomSniper() local Random = math.random(0,game.Players.NumPlayers) Sniper = Players1[Random] print(Sniper) table.remove(Players1, Random) return true end function CountDown() for i = 10,0,-1 do IntermissionGUI.Value = "Intermission: " .. i local Sound = Instance.new("Sound",game.Workspace) Sound.SoundId = "http://www.roblox.com/asset/?id=134641113" Sound:Play() wait(1.5) Sound:Remove() end end function PlayerToNumber() local Players = game.Players:GetChildren() print("Activating") for i,v in pairs(Players) do table.insert(Players1,i,v.Name) print(Players1[i]) end return true end function SniperToPosition() print(RandomSniper()) if RandomSniper() == true then local Sniper1 = game.Players:FindFirstChild(Sniper) print(Sniper1.Name) Sniper1.Character.Torso.CFrame = game.Workspace.SpawningPart.CFrame local Gun = game.ServerStorage.Sniper:Clone() Gun.Parent = Sniper1.Backpack end end function PlayersToPosition() for _,v in pairs(Players1) do if v ~= Sniper then game.Players:FindFirstChild(v).Character.Torso.CFrame = game.Workspace.PlayerSpawningPart.CFrame + CFrame.new(0,2,math.random(-20,20)) wait(3) end end end function RestartTheGame(Player) if Player.Parent.Humanoid ~= nil and Player.TeamColor == "Really blue" and Player.Parent.Humanoid.Health > 0 and game.ReplicatedStorage.GameInProgress.Value == true then local Players = game.Players:GetChildren() for _,v in pairs(Players) do game.Players:FindFirstChild(v.Name).Character.Torso.CFrame = game.Workspace.SpawningPart.CFrame + CFrame.new(math.random(-8,8),2,math.random(-8,8)) end if game.ReplicatedStorage.NumberOfPlayers.Value > 1 then game.ReplicatedStorage.GameInProgress.Value = true CountDown() PlayerToNumber() RandomSniper() SniperToPosition() PlayersToPosition() end end end game.Players.PlayerAdded:connect(function() local PlayerCount = game.ReplicatedStorage.NumberOfPlayers.Value PlayerCount = PlayerCount + 1 end) game.Players.PlayerRemoving:connect(function() local PlayerCount = game.ReplicatedStorage.NumberOfPlayers.Value PlayerCount = PlayerCount - 1 end) game.ReplicatedStorage.NumberOfPlayers.Changed:connect(function() local Players = game.Players:GetChildren() if #Players > 1 and game.ReplicatedStorage.GameInProgress.Value == false then game.ReplicatedStorage.GameInProgress.Value = true game.ReplicatedStorage.MoreThan2Players.Value = true CountDown() PlayerToNumber() RandomSniper() SniperToPosition() PlayersToPosition() else game.ReplicatedStorage.MoreThan2Players.Value = false end end) game.Workspace.WinBlock.Touched:connect(RestartTheGame)