local function if_player_is_on_round_or_another(player) return player:GetAttribute("EnvironmentID") ~= nil end local function chid_to_id(chid) return string.byte(chid or string.char(0)) end local function id_to_chid(id) return string.char(id or 0) end local function get_every_player_in_Environment(id) local output = {} for k, v in pairs(game:GetService("Players"):GetChildren()) do if v:IsA("Player") and if_player_is_on_round_or_another(v) and chid_to_id(v:GetAttribute("EnvironmentID")) == id then table.insert(output, {["chidteam"] = v:GetAttribute("TeamID"),["player"] = v}) end end return output end local function get_every_player_in_Environment_but_without_thisteam(id,id2) local output = get_every_player_in_Environment(id) for k = #output, 1, -1 do local v = output[k] if chid_to_id(v["chidteam"]) == id2 then table.remove(output, k) end end return output end local function get_every_player_in_Environment_but_only_enemy(id,id2) local output = get_every_player_in_Environment(id) for k = #output, 1, -1 do local v = output[k] if chid_to_id(v["chidteam"]) ~= id2 then table.remove(output, k) end end return output end